Use the COM component of MICROSOFT to write a program that inserts data into EXCEL and then downloads it to the client machine. The test passed during development, but the following error occurred after uploading to the WIN2000 server:
Server Error in '/Webqr' Application.
-------------------------------------------------- ----------------------------------
access 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 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.
Since this situation occurred during local testing, I looked for solutions online and tried the following solutions:
1. Increase the permissions of IIS_USER and add IIS_USER to ADMINISTRATOR. Personally, I think this is a security risk, so I do not use it.
2. In Start->Run, enter the dcomcnfg configuration, the security permissions of the EXCELcom file, edit the startup permissions, and an error occurs after the configuration permissions are modified.
Server Error in '/Webqr' Application.
-------------------------------------------------- ----------------------------------
Object reference not set to an instance of an object
http://www.cnblogs.com/sherry/archive/2006/07/25/459248.html