Chandan Sarkar
Chandan Sarkar

Reputation: 11

How to open folder from web page

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

Answers (3)

user3754876
user3754876

Reputation: 1

Maybe this statement can help you:

 System.Diagnostics.Process.Start(@"C:\");

Upvotes: -1

Amar Palsapure
Amar Palsapure

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

ChrisBD
ChrisBD

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

Related Questions