访问被拒绝。 (HRESULT异常:0x80070005(E_ACCESSDENIED)) [英] Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

查看:1112
本文介绍了访问被拒绝。 (HRESULT异常:0x80070005(E_ACCESSDENIED))的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我编写了使用OpenXML生成xlsx文件的代码。它通过IIS和visual studio在我的本地机器上运行良好。我已经在Windows Server 2003和Windows Server 2008上托管了Web应用程序.excel文件可以很好地生成小数据。但是当数据很大,即超过300行和20列时,我得到了异常访问被拒绝。(HRESULT异常:0x80070005(E_ACCESSDENIED))。



我在Google上检查了这个问题并找到了Windows Server 2003的解决方案,他们提到了在以下路径中创建名为IsolatedStorage的文件夹C:\Documents and Settings \Default User \ Local Settings \ Application数据并授予IIS_WPG修改和写入权限。这解决了Windows Server 2003上的问题,现在我的Web应用程序生成了包含大量数据的excel文件。



对于Windows Server 2008,有人提到做了更改在以下注册表中:



重命名注册表HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft \ Windows NT \ CurrentVersion \ProfileList \S-1-5-20 to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft \ Windows NT \ CurrentVersion \ProfileList \S-1-5-20-backup



这个没解决问题,但为我创造了另一个问题,现在重新启动服务器后,我无法登录到我的服务器。



我遇到了这个问题来自最近5天,请帮助我解决Windows服务器2008上访问被拒绝。(HRESULT异常:0x80070005(E_ACCESSDENIED))的问题。



供参考请查看附带的屏幕截图,显示错误和一些部分代码。



谢谢,

Kunal Khosla

Hello,

I have written code to generate xlsx file using OpenXML. It's working very well on my local machine through IIS and through visual studio. I have hosted the web application on windows server 2003 and on windows server 2008. The excel file are generating fine for small data. But when the data is large i.e. more than 300 rows and 20 columns then I'm getting the exception "Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))".

I checked for this issue on Google and found solution for windows server 2003 where they have mentioned to create folder named IsolatedStorage at the following path "C:\Documents and Settings\Default User\Local Settings\Application Data" and give the permission for IIS_WPG to modify and write. This solves the problem on the windows server 2003 and now my web application generating the excel files with large amount of data.

For windows server 2008 someone has mentioned to made change in the following registry:

Rename the registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-20 to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-20-backup

This didn't solve the problem but creates another problem for me, now after rebooting the server I'm not able to log in to my server.

I'm stuck in this problem from last 5 days, please help me regarding solving the problem "Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))" on windows server 2008.

For reference please check the attached screenshot showing the error and some part of the code.

Thanks,
Kunal Khosla

推荐答案

您好Kunal,



检查excel文件(它是否为只读)。如果您已经授予相应文件和文件夹的所有权限,请尽可能分享您的代码。



Ajit
Hi Kunal,

Check for the excel file (it is read only or not). If you have given all the permission to respective files and folder, then share your code if you can.

Ajit


什么你是用来将数据转储到Excel工作表..我的意思是OLE DB或其他不同的东西..



检查对象的关闭和打开..或更好的使用关键字...



如果你可以分享你的代码,那么回复会很好....
What are you using for dumping the data into excel sheet.. i mean OLE DB or something different..

check for the closing and opening of object.. or better to use Using keyword...

If you can share you code it would be good to response ....


这篇关于访问被拒绝。 (HRESULT异常:0x80070005(E_ACCESSDENIED))的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆