Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Displaying Local Directory Information

Posted on 2004-08-13
11
Medium Priority
?
165 Views
Last Modified: 2010-04-23
Hi,

I want to display directory information for the user's LOCAL computer via a web application.  I wrote the following code...

--------------------------------------------------------------------------------------------------------
        Dim dir As String = "C:\"
        Dim files, dirs As String()
        Dim fileName, directoryName As String

        If Directory.Exists(dir) Then

            dirs = Directory.GetDirectories(dir)
            files = Directory.GetFiles(dir)

            For Each fileName In files
                lblFiles.Text += fileName & ", "
            Next

            For Each directoryName In dirs
                lblDirectories.Text += directoryName & ", "
            Next

        Else

            lblError.Text = "Invalid directory: " & dir

        End If
--------------------------------------------------------------------------------------------------------

This lists the files on the web server.  Is there any way to list the local files on a user's computer?

Ryan

0
Comment
Question by:RySk8er30
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +2
11 Comments
 
LVL 17

Expert Comment

by:AerosSaga
ID: 11793154
In short, no this is a security risk

Regards,

Aeros
0
 
LVL 6

Accepted Solution

by:
pillbug22 earned 250 total points
ID: 11793182
I'm thinking you'll need to use a client-side script (VBScript, JavaScript, etc) to do this.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/jsobjFileSystem.asp


However, I also think I remeber MS patching IE so you couldn't read the file system via web-script any more (spyware/hackers)
0
 
LVL 4

Assisted Solution

by:w3tim
w3tim earned 250 total points
ID: 11793893
By default, most browsers would have security settings preventing a webpage from doing this, as Aeros said it's a security risk.  An ActiveX component might be able to do this.

Otherwise, i would abandon this as an idea as a lot of anti-virus software and anti-ad/spyware software will block any client scripts that may attempt to access the file system.  They would probably assume the script is trying to exploit the system.

Hope this helps.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:RySk8er30
ID: 11821589
I would like to delete this question since I have not recieved an answer.

Ryan
0
 
LVL 6

Expert Comment

by:pillbug22
ID: 11821647
You can post a message in the Community Support area and request a delete.

Although receiving an unwanted/unfavorable answer isn't the same as not receiveing an answer.
0
 
LVL 17

Expert Comment

by:AerosSaga
ID: 11821661
I agree you got the answer
0
 
LVL 4

Expert Comment

by:w3tim
ID: 11821855
I agree with AerosSaga and pillbug22.  An answer that states that a reasonable solution is not possible or unlikely, although not what the person posing the question wanted, is still an answer!
0
 
LVL 17

Expert Comment

by:AerosSaga
ID: 11823776
My previous post indicates my position.

Regards,

Aeros
0
 
LVL 6

Expert Comment

by:pillbug22
ID: 11823810
Ditto.
0
 

Expert Comment

by:RomMod
ID: 11823894
RySk8er30 has chosen to award the points.

RomMod
Community Support Moderator
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question