我在用StreamWriter的时候出了些问题。请教大家 。
我在本地的admin目录里的一个Page里用到StreamWriter,目的是在要目录写一个文件。在本地的时候完全正常。便是传到网上去就有错误了,提示是:对admin目录没有访问权限的意思
这是为什么?我是在根目录写文件啊,最多是要目录错误啊

解决方案 »

  1.   

    回复楼上的, yeke888(小二郎dfgdfg,但是我操作是的根目录,不是admin目录啊。这是我奇怪的地方。能不能解释一下呢
      

  2.   

    Server Error in '/' Application.
    --------------------------------------------------------------------------------Access to the path "E:\fjbiz\adminpage" is denied. 
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.UnauthorizedAccessException: Access to the path "E:\fjbiz\adminpage" is denied. ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user. To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  Stack Trace: 
    [UnauthorizedAccessException: Access to the path "E:\fjbiz\adminpage" is denied.]
       System.IO.__Error.WinIOError(Int32 errorCode, String str) +393
       System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFromProxy) +888
       System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) +44
       System.IO.StreamWriter.CreateFile(String path, Boolean append) +55
    这是我的部分错误内容大家帮忙看一下