Windows2003IIS asp.net写文件失败问题 急!。。。

welic_dian_net 2010-11-22 11:22:18
Server Error in '/' Application.
--------------------------------------------------------------------------------

Access to the path 'c:\windows\system32\inetsrv\btw3.tmp' 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 'c:\windows\system32\inetsrv\btw3.tmp' 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.

Source Error:


Line 556: row.Height = 40;
Line 557:
Line 558: wbook.Save(Server.MapPath(filename));
Line 559: }
Line 560:}


Source File: c:\HNDL\UltimateManageSystemFB\GenerateTaskSheet.aspx.cs Line: 558

Stack Trace:


[UnauthorizedAccessException: Access to the path 'c:\windows\system32\inetsrv\btw3.tmp' is denied.]
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +2014291
System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) +998
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) +115
System.IO.File.Create(String path) +37
Biff8Excel.Excel.ExcelBinaryWriter.Write(Byte[] buffer) in F:\Biff8_C#_Excel\Biff8\Excel\ExcelBinaryWriter.cs:77
Biff8Excel.Excel.ExcelWorksheet.CreateSheetBuffer() in F:\Biff8_C#_Excel\Biff8\Excel\ExcelWorksheet.cs:228
Biff8Excel.Excel.ExcelWorkbook.Save(String fname) in F:\Biff8_C#_Excel\Biff8\Excel\ExcelWorkbook.cs:421
GenerateTaskSheet.TestWriteExcel(String filename, MainPrjInfo mprj, SubPrjInfo[] subprjArr) in c:\HNDL\UltimateManageSystemFB\GenerateTaskSheet.aspx.cs:558
GenerateTaskSheet.GenerateTaskSheetCSV(String nf, String lshh) in c:\HNDL\UltimateManageSystemFB\GenerateTaskSheet.aspx.cs:54
GenerateTaskSheet.Page_Load(Object sender, EventArgs e) in c:\HNDL\UltimateManageSystemFB\GenerateTaskSheet.aspx.cs:35
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061


UnauthorizedAccessException: Access to the path 'c:\windows\system32\inetsrv\btw3.tmp' is denied
高手们帮忙解决一下,给文件夹添加安全账户“ASPNET”已经试过了,不行。
用同样的方法在XP里就能解决问题,很是郁闷,Why...?
...全文
62 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
仙儿 2010-11-22
  • 打赏
  • 举报
回复
添加一个everyone呢或者user用户呢?

62,272

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧