Reputation: 11
I want to open folder from web page on clicking on a button.
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("file://C://inetpub//wwwroot//myproject");
}
Please suggest me proper code in C# for open myproject folder.
Upvotes: 0
Views: 16552
Reputation: 1
Maybe this statement can help you:
System.Diagnostics.Process.Start(@"C:\");
Upvotes: -1
Reputation: 9680
This can be ONLY done in IE, no other browser has access to file system. You can assign the path to href of an anchor tag, and it should work.
<a href="file://LAP6//C$">Open</a>
Upvotes: 5
Reputation: 9209
If you're looking at adding functionality to your website so that a user can upload files to it then look at this project on MSDN. It'll show you how to do this with an example ASP.NET project.
Upvotes: -1