I have a requirement to open a windows explorer Path like this "C:\New Folder\" or "http:\gmail.com" using C# code. Actually, once the user types the link\path in the text box and save it, a link should appear and on clicking the link, the required folder path or link should open. My requirement is satisfied with Process.Start(). But, Process.Start is not working in IIS. Can any one suggest any other options. Please.
The code am using is below.
string myPath = @"c:\backoffice";
System.Diagnostics.Process prc = new System.Diagnostics.Process();
prc.StartInfo.FileName = myPath;
prc.Start();
Talk1:
What you expect will happen when you open an Explorer window from IIS? In other words: what do you want to do? To open an explorer window remotely (and users on server will see it)? To see server file system from remote? Something else?
Solutions1
You are misunderstanding the way the web works. If you call Process.Start on the web server, it runs that command on the web server. There is no way that the Process.Start is magically mapped to some action on the client.
Also, you can't just open a specific folder on the client machine from a web site. The security protocols implemented in the browser will prevent that.
Talk1:
Hi, Thanks for answering my question. I actually want to open a folder on the server where the site is deployed from a client machine. Is there any other work around other than Process.Start? Regards, Veera
Talk2:
You can't, since IIS is a background service. It cannot interact with the desktop.
Talk3:
I actually want to open a folder on the server where the site is deployed from a client machine.
Talk4:
HI All, I hope so the requirement is not clear. The UI will have a textbox in which the user can type any path like C:\Testfolder\. Once he click save button, the Path will turn out to be a link where he can click. Once he click the link, the path should open if he has access. ie. C:\Testfolder should open. This testfolder will refer to the folder where the web application is deployed. Is there any option do this other than Process.Start. Any suggestions, Please
Talk5:
: Need more help? If not, please don't forget to accept the answer.