和Excel相关的代码如下: using Excel;
Excel.Application excel = new Excel.Application();
excel.Application.Workbooks.Add ( true ) ;
excel.Visible = true ;
编译完成后却出现以下的错误信息:拒绝访问。
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: 拒绝访问。 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.哪位高手指点一下阿,
Excel.Application excel = new Excel.Application();
excel.Application.Workbooks.Add ( true ) ;
excel.Visible = true ;
编译完成后却出现以下的错误信息:拒绝访问。
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: 拒绝访问。 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.哪位高手指点一下阿,
解决方案 »
- OWC画图报拒绝访问是怎么回事?
- discuz 更给虚拟目录
- 我从小到大排序五个数字,请问错在哪里?
- 求助:值不能为空。参数名: String
- 在datalist中动态绑定单选安钮RadioButton无法实现单选效果!
- asp.net中,如何点击按钮为table动态增加和删除行。
- Session["UserName"]=string.Empty;和Session["UserName"]="";一样吗 ?
- 急求flash mx和Dot Net交互的文章
- image类型参数如何接受null值呢?
- 求助:校验问题,在线等待!!
- 大家帮忙看看这是什么错误啊?好多离子我都看不了,呜呜...
- datagrid中点删除按钮没有反映???
如果是Window2003 ->控制面版 -> 管理工具 -> 组件服务 ->
打开树级目录找到子目录DCOM配置 -> Microsoft Excel 应用程序
-> 右击选“属性” -> 在弹出对话窗口中选“安全”选项卡->
-> 将启动和激活权限设为自定义->点击编辑按钮->
->在新窗口中将Everyone用户加入,选中复选框"启动权限",给予启动权限如果是WindowXP ->控制面版 -> 管理工具 -> 组件服务(繁体为"元件服务") ->
打开树级目录找到子目录DCOM配置 -> Microsoft Excel 应用程序
-> 右击选“属性” -> 在弹出对话窗口中选“安全”选项卡->
-> 将启动和激活权限设为自定义->点击编辑按钮->
->在新窗口中将Everyone用户加入,选中复选框"远程启动",给予远程启动权限
具体请看:
http://blog.csdn.net/ChengKing/archive/2005/11/29/539514.aspx