从ıss7访问远程共享文件 [英] accessing remote shared file from ııs7

查看:91
本文介绍了从ıss7访问远程共享文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在C#中有一个Web应用程序,在目录"\\\\ 10.90.233.203 \\ mps \\ dialcodes.csv"中创建了一个csv文件,并且使用它的方式如下所示:

System.IO.StreamWriter StreamWriter1 =
new System.IO.StreamWriter(@"\\\\ 10.90.233.203 \\ mps \\ dialcodes.csv",false,Encoding.Default);


当我从本地主机运行该代码时,该代码运行良好;但是当我将代码放在IIS服务器上时,会出现以下错误:

访问路径\\ 10.90.233.203 \ mps \ dialcodes.csv;被拒绝


我认为其原因与用户授权有关.我为应用程序池使用了网络服务,此外,在我的文件夹mps退出的服务器中,我会进行所有安全授权.我可以完全控制mps文件夹中的网络服务.但是什么都没有改变,会出现相同的错误.目录.


I have a web application in c#, creating a csv file in the directory "\\\\10.90.233.203\\mps\\dialcodes.csv" and I used it just like the following :

System.IO.StreamWriter StreamWriter1 =
new System.IO.StreamWriter(@"\\\\10.90.233.203\\mps\\dialcodes.csv", false, Encoding.Default);


The code works well when I run it from my localhost; but when I put my code on IIS server the following error appears :

Access to the path \\10.90.233.203\mps\dialcodes.csv; is denied


I think the reason for that is related to user authorization. I used network service for my application pool.Besides, in the server in which my folder mps exits I do all af the security authorization. I give full control for network service in my mps folder.But nothing changed, the same error appears.

解决方案

Try putting the file into your web site''s virtual directory somewhere.


这篇关于从ıss7访问远程共享文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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