c 中打开服务器上的文件夹,Process.Start在IIS中不起作用.打开Windows文件夹路径的任何选项,例如:C:\...

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.

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值