http://localhost/sigo 和 http://192.168.0.22/ sigo 可以打开我的网站http://localhost/sigo/selected.aspx?file=aa.txt
上面情况下可以打开文本文件aa.txt可是换成我的局域网IP地址,本机都打不开aa.txt,浏览器说"该页无法显示..."http://192.168.0.22/sigo/selected.aspx?file=aa.txt如何设置权限?我已经把文件夹设置为共享了。

解决方案 »

  1.   

    因为你的iis的ip不是你的说的另外一个IP即"我的局域网IP地址"
      

  2.   


    http://localhost/sigo/files/aa.txt 可以打开http://192.168.0.22/sigo/files/aa.txt 也可以打开
    可是我
    string filepath = Server.MapPath("d://sigo//files//"+ filename);Response.Redirect(filepath); 在第一种情况可以打开,在192.168.0.22时候不行
      

  3.   

    string filepath = Server.MapPath("/sigo/files")+ filename;
      

  4.   

    string filepath = Server.MapPath("/sigo/files")+ filename;
      

  5.   

    试试IIS里把IP绑定为192.168.0.22
      

  6.   

    用绝对地址引用的方法一般不推荐,
    string filepath = Server.MapPath("/sigo/files")+ filename;
      

  7.   

    http://192.168.0.22/sigo/selected.aspx?file=aa.txt
    这样的方式是用aspnet用户的身份访问文件
    http://192.168.0.22/sigo/files/aa.txt
    这样的方式是用iis的那个用户访问文件
    你可以通过看aa.txt的安全属性看是否赋予用户相应的权限