IRONSOFTWAREHOME

IronWebScraper 適用於 ASP.NET 的授權金鑰

Curtis Chau
Curtis Chau
Updated: 2026年6月29日

此問題已於 IronWebScraper 版本 2024.3.6 解決

Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronWebScraper must be licensed for development.
Text

針對較舊版的 IronWebScraper(具體而言是 2023.4.132024.3.6 之間的版本),在以下位置存在已知授權問題:

  • ASP.NET 專案
  • .NET Framework 版本 >= 4.6.2

儲存於 Web.config 檔案中的金鑰,本產品將不會讀取或使用。

解決方案

為解決此問題,建議在程式碼中使用 ConfigurationManagerWeb.config 檔案中擷取授權金鑰,然後將其套用至 License.LicenseKey 屬性。

範例:

<configuration>
  ...
  <appSettings>
    <add key="IronWebScraper.LicenseKey" value="IRONWEBSCRAPER-MYLICENSE-KEY-1EF01"/>
  </appSettings>
  ...
</configuration>
XML

透過上述提供的 XML 檔案,我們可以使用 ConfigurationManager 擷取授權金鑰值,並將其傳遞給 IronWebScraper.License.LicenseKey 屬性。

// Retrieve the license key from the appSettings section of the Web.config file.
string licenseKey = ConfigurationManager.AppSettings["IronWebScraper.LicenseKey"];

// Assign the license key to the IronWebScraper's LicenseKey property.
IronWebScraper.License.LicenseKey = licenseKey;
Curtis Chau
技術作家

Curtis Chau擁有Carleton大學的電腦科學學士學位,專精於前端開發,擁有Node.js、TypeScript、JavaScript和React的專業知識。Curtis熱衷於建立直觀且美觀的使用者介面,喜愛使用現代框架並建立結構良好、視覺吸引力的手冊。

...
閱讀更多

準備好開始了嗎?

Nuget Downloads 145,501版本:2026.9剛剛發布

立即獲取您的免費 30 天試用金鑰
不需要信用卡或帳戶建立
Key in blue circle

立即免費取得 30 天試用金鑰

Your trial license will be sent to your email address

無任何限制。100% 解鎖。無需信用卡。

OR
bullet_checked無需信用卡或建立帳號無任何限制。100% 解鎖。無需信用卡。
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
預約您的免費即時示範
Booking Badge

受到全球數百萬工程師的信賴

Iron Software 的客戶標誌
獲得您的無約束性諮詢
完成以下表格或發送電子郵件至 sales@ironsoftware.com
您的資料將始終保持機密。
受到全球數百萬工程師的信賴
Iron Software 的客戶標誌
立即獲取您的30天試用金鑰
無需信用卡或帳戶建立