如何访问本地目录 [英] How To Access Local Directory

查看:60
本文介绍了如何访问本地目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好



我想开发一个从本地计算机读取图像的Web应用程序(ASP.NET和C#)(浏览该应用程序的用户的计算机) )。单击表单中的一个按钮时,应用程序应从本地计算机目录中读取图像(已配置目录名称)。我怎样才能做到这一点。是否有可能通过JAVA SCRIPT或C#



感谢和问候

Hi All

I want to develop an web application (ASP.NET and C#) that will read image from local computer (Computer of the user browsing that application). While clicking one button in the form, the application should read the image from local computer directory (Directory name is configured). How can I do this. Is it possible to do this either by JAVA SCRIPT or C#

Thanks & Regards

推荐答案

嗯,在ASP.NET服务器端代码可以在服务器机器上访问。它们对客户端系统没有任何控制权 - 因此即使配置了路径,也不能使用C#服务器代码。



剩下的就是使用 Javascript中的ActiveX文件对象来访问客户端系统和文件。

首先,看看这些:通过Jsavascript访问文件 [ ^ ]

Link 2 [ ^ ]

Link 3 [ ^ ]



谷歌更多,如果需要。
Well, in ASP.NET server side code has access on server machine. They don't have any control on client system - so you cannot use C# server code for the same even if the path is configured.

What is left with you is to use ActiveX file object in Javascript to access client system and files.
To start with, have a look at these: File access via Jsavascript[^]
Link 2[^]
Link 3[^]

Google for more, if needed.


这篇关于如何访问本地目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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