Reputation: 179
I am going to develope a module in ASP.Net. In this module I want to get the list of drives of the local system where this page is displaying. I have already tring with System.IO.... etc. but it gives me the server drives.
I want to get the list of LOCAL drive where page is displaying on server drives.
Thank you.
Upvotes: 0
Views: 1420
Reputation: 4865
You can write a .NET control which is downloaded from your website to the clients' PC and looks at the drives there. As this could be abused (you could steal the users' files) you will have to convince the user to download the control in the first place. Look here for more info: ClickOnce Deployment overview
Upvotes: 0
Reputation: 416039
Remember: your C# or VB.Net code runs on the server for the explicit purpose of sending html/javascript to the client browser. It does not get to peek directly at the "local" system, and the only thing the "local" system knows about is the html/javascript rendered on the server. That's just how the web works.
Furthermore, javascript runs in a sandbox that does not include any way to enumerate the local drives. This is by design.
So the only way to do this is via plug-in like flash, silverlight, or activex.
Upvotes: 0
Reputation: 26782
This is impossible, since your ASP.Net code runs on the server. The client only sees the rendered page (HTML and javascript).
Upvotes: 1
Reputation: 115809
This absolutely cannot be done with neither server-side ASP.NET, nor with client-side JavaScript. You can try writing an ActiveX "control" (or how are these called?) or Java applet.
Upvotes: 1
Reputation:
Do you mean the client's computer's drives? That is not possible.
EDIT: However, it is possible with ActiveX or a browser plug in.
Upvotes: 2