我写了个读取文件的源代码,代码没有错,因为我用vs内置服务器看了,很正常,但是我用iis看,就出现了这样地问题。 Exception Details: System.UnauthorizedAccessException: Access to the path 'E:\ztx\website\File\abce.txt' 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 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.
代码如下: FileStream aFile = null;
aFile = new FileStream(@"E:\ztx\website\File\abce.txt",FileMode.Open);
Response.Write("Ol");
代码如下: FileStream aFile = null;
aFile = new FileStream(@"E:\ztx\website\File\abce.txt",FileMode.Open);
Response.Write("Ol");
解决方案 »
- Update 无法找到 TableMapping['Table'] 或 DataTable“Table”
- 请教:字符串中前多少位是A-E之间的字母,谢谢
- 菜鸟有个问题想不明白...
- 多窗口问题
- 请问一个普通的.NET程序发布给用户需要包含哪些东西?一般有多大?
- 高分求救,C#如何切换应用程序角色呀
- webbrowser 逐一点击网页内链接
- 高分求救,调用VC6写的DLL时报错
- 在C#中怎么让Progressbar在状态栏中像IE浏览器一样靠右边对齐啊?
- 出学者:新建项目C#出错(请看详细内容),这是为什么?????
- 请问,这个想法能否实现,DateTime继承?
- 数据库创建连接问题(在线等...)
添加asp.net用户