如何通过ASP.NET访问位于Lan中的文件. [英] how to access a file which is located in Lan through ASP.NET.

查看:71
本文介绍了如何通过ASP.NET访问位于Lan中的文件.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友,

谁能告诉我如何通过ASP.NET访问位于LAN中的文件.

我正在gridview中显示Excel文件中的数据.
将Excel文件存储在同一台计算机上时,该应用程序可以正常运行.
但是当来自不同位置的文件应该是
"\\ 10.91.86.152 \ Shared Folder".

我无法访问它.

非常感谢您的回复.

Kishor

Hi friends ,

Can anyone please tell me how to access a file located in LAN through ASP.NET.

I am displaying a data from Excel file in a gridview.
The Excel file when strored on same computer the application works fine.
but when the file from different location suppose
"\\10.91.86.152\Shared Folder" .

I am not able to access it.

Thank you very much for response.

Kishor

推荐答案

您确定您的应用程序对该位置具有写权限吗?
Are you sure your application have write access to the location??


但是当文件来自假设位置不同
"\\ 10.91.86.152 \ Shared Folder".我无法访问它.

这仅表示您没有该用户对该文件夹的 read 访问权限.

首先,请确保您能够使用Windows-run命令正常访问该位置.如果您在web.config中使用某些模拟"功能,请确保该用户名具有访问权限.如果没有模拟,则应该正确配置ASPNET的权限.
but when the file from different location suppose
"\\10.91.86.152\Shared Folder" .I am not able to access it.

It simply means you don''t have the read access on the folder for the user.

To start with, make sure you are able to access the location normally using your windows-run command. If you are using some ''impersonation'' in your web.config, then make sure that this username has access permissions. If no impersonation, then ASPNET should have the permission correctly configured.


您可以尝试Server.MapPath(");.解决您的问题.
You can try Server.MapPath(""); solve your problme.


这篇关于如何通过ASP.NET访问位于Lan中的文件.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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