本文介绍了的Process.Start不是工作在IIS。任何选项来打开Windows文件夹path.eg:C:\ Newfolder的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个要求,开这样的windows资源管理器路径C:\新建文件夹\或HTTP:\ gmail.com使用C#code。事实上,一旦用户类型的链接\路径在文本框中并保存,一个链接应该出现并点击链接,所需的文件夹路径或链接应该打开。我的要求是满意的Process.Start()。但是,的Process.Start不是工作在IIS。任何一个可以提出任何其他的选择。请。

在code现在用的就是以下。

 字符串mypath中= @C:\后台;
 的System.Diagnostics.Process中国=新的System.Diagnostics.Process();
 prc.StartInfo.FileName = mypath中;
 prc.Start();
 

解决方案

您是误会了网络的工作方式。如果你调用的Process.Start 在Web服务器上,它运行在Web服务器上的命令。有没有办法了的Process.Start 被神奇地映射到客户端上的一些行动。

另外,你不能只从一个网站打开客户端计算机上的特定文件夹。在浏览器中实现的安全协议将prevent那

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();
解决方案

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.

这篇关于的Process.Start不是工作在IIS。任何选项来打开Windows文件夹path.eg:C:\ Newfolder的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 15:36