ASP.NET 拒絕訪問

來源:互聯網
上載者:User
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



聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.