Help! Browse folder option in asp.net (C#) - The code does not wor

J

Jay-pm

I am trying to browse folders through the following piece of code.
Please let me know if there is any kind of setting to get this working
right?


using shell32.dll;
Shell32.ShellClass shl = new Shell32.ShellClass();
Shell32.Folder2 fld = (Shell32.Folder2)shl.BrowseForFolder(0, "Show Folder",
0, System.Reflection.Missing.Value);
txtFolderName.Text = fld.Self.Path ;

Thanks in advance.

Regards,

Jay
 
M

Marc Gravell

The C# side of ASP.NET runs at the server, but I'm guessing you want this to
appear at the client - in which case you need to limit yourself to [d]html
and javascript etc. Normally this means an <input type="file"/>. You can do
more, but it involves running something addition at the client - such as an
ActiveX control or Silverlight (which actually has pretty good support for
secure file browsing, from what I've seen...).

Marc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top