Access is denied

yuyi1991616 2013-03-25 04:49:41
Access 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 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:


Line 76: DateTime sTimes,eTimes;
Line 77: sTimes = DateTime.Now;
Line 78: Excel.ApplicationClass oExcel = new ApplicationClass();
Line 79: eTimes = DateTime.Now;
Line 80:



这个Excel怎么弄都总数拒绝访问,我已经在web.fig文件加了
    <identity impersonate="true" userName="np1-it-10602\it-pds" password="pds123" />


又在machine.config里改了:
		<processModel enable="true" timeout="Infinite" idleTimeout="Infinite" shutdownTimeout="0:00:05" requestLimit="Infinite" requestQueueLimit="5000" restartQueueLimit="10" memoryLimit="60" webGarden="false" cpuMask="0xffffffff" userName="np1-it-10602\it-pds" password="pds123" logLevel="Errors" clientConnectedCheck="0:00:05" comAuthenticationLevel="Connect" comImpersonationLevel="Impersonate" responseDeadlockInterval="00:03:00" maxWorkerThreads="20" maxIoThreads="20"/>


    <identity impersonate="true" userName="np1-it-10602\it-pds" password="pds123" />


又把权限给了full control了,为什么还是访问拒绝~!!一周了,还是解决不了,求搭救~
...全文
383 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
yuyi1991616 2013-03-25
  • 打赏
  • 举报
回复
解决了~可能是改的东西太多了,我把新建的用户删了,重新建就好了~
  • 打赏
  • 举报
回复
Access is denied 权限配置一下。 修改文件夹权限:文件夹权限配置组图
  • 打赏
  • 举报
回复
你把你的excel文件扔到webapplication的目录下就可以的了。 用户权限问题。你看看你的文件夹的用户列表和iis下的文件夹的用户列表不一样的

110,524

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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