asp.net|訪問
使用MICROSOFT的com組件編寫插入資料到EXCEL然後再下載到客戶機本機程式,在開發時測試通過,上傳到WIN2000伺服器上後出現如下錯誤:
Server Error in '/Webqr' Application.
--------------------------------------------------------------------------------
拒絕訪問。
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.
由於本機測試的時候就出現這種情況,在網上尋找解決方案,嘗試解決的方法如下:
1。提高IIS_USER的許可權,將IIS_USER加入ADMINISTRATOR,個人覺得這樣做有安全風險,故不採用
2。在開始-》運行 輸入dcomcnfg配置,EXCELcom檔案的安全性許可權,編輯啟動許可權,配置許可權
修改完成後出現錯誤
Server Error in '/Webqr' Application.
--------------------------------------------------------------------------------
Object reference not set to an instance of an object