如何使用C#通过使用IIS7配置我的网站来打开服务器中的文件夹 [英] how to open folder in server using C# by configuring my website with IIS7

查看:64
本文介绍了如何使用C#通过使用IIS7配置我的网站来打开服务器中的文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当Iam尝试使用IIS时,如何打开服务器中存在的文件夹

how to open a folder which is present in server using IIS when Iam trying this

System.Diagnostics.Process.Start("explorer.exe", @"\\0.0.0.0\est\Share\111")



在本地机器上工作正常,但当我配置我的网站时IIS7它不起作用。

请帮帮我..


in local machine is working fine ,but when I config my website with IIS7 it does't works.
pls help me..

推荐答案

当然有效!

它只是不做什么你期望的......



它正是你在开发机器上测试它时所做的 - 在服务器上打开一个Windows资源管理器实例(和窗口)。但是当它在您的开发机器上时,您可以看到它,因为客户端和服务器是同一台计算机。

现在您已投入生产,但事实并非如此。因此客户端无法看到窗口,因为(与所有其他C#代码一样)它在服务器而不是客户端上执行。



可能做的事情让你的网络主机管理员烦恼,因为你正在打开你无法关闭的窗户...



你做不到。它不起作用,即使这样做也会是一个巨大的安全漏洞,可能会让你在极端偏见的情况下被抛出服务器!
Of course it works!
It just doesn't do what you expected...

It is doing exactly what it was when you tested it on your development machine - opening a Windows Explorer instance (and window) on the server. But when it was on your development machine, you could see it, because the client and the server were the same computer.
Now you are in production, and they aren't. So the client can't see the window, because (like all other C# code) it is executed on the server and not the client.

What you are probably doing is annoying the heck out of your web host administrator, since you are opening windows you can't close...

You can't do that. It doesn't work, and even if it did it would be an enormous security hole which would probably get you thrown off the server with extreme prejudice!


这篇关于如何使用C#通过使用IIS7配置我的网站来打开服务器中的文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆