代码之家  ›  专栏  ›  技术社区  ›  dbones

在ASP承载的Web服务中拒绝文件流访问

  •  0
  • dbones  · 技术社区  · 15 年前

    我有以下内容

    //get the data as a string.
     using (FileStream fs = File.Open(location, FileMode.Open))
     using (StreamReader reader = new StreamReader(fs))
     {
         rawData = reader.ReadToEnd();
     }
    

    在wcf主机的web配置中

    <authentication mode="Windows"/>
    <identity impersonate ="true"/>
    

    但是我得到这个错误

    访问路径“d:\some dir\rules.txt”

    宿主在IIS6中的主机使用virdir,annon access帐户为me,rules.txt具有我的完全访问权限。

    我错过了什么。我也给了“每个人”机会,但没有运气。

    1 回复  |  直到 15 年前
        1
  •  0
  •   dbones    15 年前

    解决了的,

    已授予访问网络服务帐户的权限