C#错误纠正

来源:百度知道 编辑:UC知道 时间:2024/05/11 12:22:02
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005.
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: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005.

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 (typ

1.组件引用错误.
2.另一个就是你没有该机的C盘修改权限,那怕是你用自己的机器名,当你使用机器名时就已经是网络操作了,而非本地操作

服务器上没装excel,你是用com组件的方式操作excel,和手动双击一个xls进入excel没什么区别.

另外既便是服务器提供了excel功能时,你也保证不了@"c:\book.xls"存在啊

路径不对。。