从Chrome中的C#web-application打开本地目录 [英] Open local directory from C# web-application in chrome

查看:318
本文介绍了从Chrome中的C#web-application打开本地目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮助我们

我们已经构建了一个内部网web应用程序(仅在公司内部使用 - 因此安全问题无关紧要!)。我们有几种情况,我们在Web应用程序中有一个链接,应该访问本地文件系统上的本地目录。单击链接时,应打开一个Windows资源管理器实例,并打开一个目录。

pls help us
We have built an intranet web-application (that is only used inside the company - so security issues do not matter!). We have several situations, where we have a link in a web-application that should access a local directory on the local file system. When clicking on the link a windows explorer instance should open with given a directory open.

System.Diagnostics.Process.Start("explorer.exe",@"c:\teste");

推荐答案

否。

它不起作用。



C#代码在服务器上运行,而不是在客户端上运行,因此任何以C#开头的进程都将运行在用户无法看到它们的服务器上。



您不能使用C#代码在客户端上运行应用程序,除非在99%以上的情况下不会出现这种情况。这是设计的。出于安全原因:如果你这样做,那么恶意网站也可以。
No.
It won't work.

C# code runs on the Server, not the Client and so any Processes you start with C# will run on teh Server where the user cannot see them.

You cannot run applications on the client from C# code except in exceptional circumstances which do not occur in well over 99% of cases. This is by design,. and for security reasons: if you copuld do it, so could "malicious" sites.


这篇关于从Chrome中的C#web-application打开本地目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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