使用 IronPrint 許可證密鑰
如何取得許可證密鑰
新增 IronPrint 許可證金鑰後,您可以無限制地部署項目,且不會新增浮水印。
您可以購買授權金鑰或在此處註冊免費的30天試用金鑰。
步驟 1:下載最新版本的 IronPrint
步驟 2:套用您的許可證金鑰
使用代碼設定您的許可證
將此程式碼加入應用程式的啟動過程中,在 IronPrint 被使用之前。 請確保將YOUR_LICENSE_KEY替換為您的實際IronPrint授權金鑰。
using IronPrint;
class Program
{
static void Main()
{
// Apply the IronPrint license key at the start of your application
IronPrint.License.LicenseKey = "YOUR_LICENSE_KEY";
// Verify that the license key is applied
if (IronPrint.License.IsLicensed)
{
Console.WriteLine("License is applied successfully.");
}
else
{
Console.WriteLine("Failed to apply the license.");
}
// Start using IronPrint features
// Your code logic goes here
}
}Imports IronPrint
Class Program
Shared Sub Main()
' Apply the IronPrint license key at the start of your application
IronPrint.License.LicenseKey = "YOUR_LICENSE_KEY"
' Verify that the license key is applied
If IronPrint.License.IsLicensed Then
Console.WriteLine("License is applied successfully.")
Else
Console.WriteLine("Failed to apply the license.")
End If
' Start using IronPrint features
' Your code logic goes here
End Sub
End ClassImports IronPrint
Class Program
Shared Sub Main()
' Apply the IronPrint license key at the start of your application
IronPrint.License.LicenseKey = "YOUR_LICENSE_KEY"
' Verify that the license key is applied
If IronPrint.License.IsLicensed Then
Console.WriteLine("License is applied successfully.")
Else
Console.WriteLine("Failed to apply the license.")
End If
' Start using IronPrint features
' Your code logic goes here
End Sub
End Class使用 Web.Config 或 App.Config 設定您的授權
若要使用 Web.Config 或 App.Config 將金鑰全域套用至您的應用程式,請將下列金鑰新增至 appSettings 中的設定檔。
<configuration>
...
<appSettings>
<add key="IronPrint.LicenseKey" value="IRONPRINT.MYLICENSE.KEY.1EF01"/>
</appSettings>
...
</configuration>
在專案中,IronPrint版本在2024.3.6之前發佈存在已知的授權問題:
- ASP.NET項目
- .NET Framework 版本 >= 4.6.2
存儲在Web.config檔案中的金鑰未被產品識別和使用。 造訪 '在 Web.config 中設置授權金鑰' 疑難排解文章以了解更多信息。
確保IronPrint.License.IsLicensed返回true以驗證您的應用程式已正確授權。
使用 .NET Core appsettings.json 檔案設定您的許可證金鑰
要將密鑰全域應用於您的 .NET Core 應用程式:
- 在您的專案根目錄中添加一個名為
appsettings.json的JSON檔案。 - 在您的 JSON 設定檔中新增一個名為「IronPrint.LicenseKey」的鍵。其值應為您的許可證密鑰。
- 確保檔案屬性包含 複製到輸出目錄: 始終複製。
文件:appsettings.json
{
"IronPrint.LicenseKey": "IRONPRINT.MYLICENSE.KEY.1EF01"
}
步驟 3:驗證您的許可證金鑰
驗證已安裝的授權金鑰
若要驗證許可證金鑰是否已正確套用,您可以檢查IsLicensed屬性。 請使用以下程式碼片段:
using IronPrint;
class LicenseCheck
{
static void Main()
{
// Check if the license is applied
bool isLicensed = IronPrint.License.IsLicensed;
Console.WriteLine(isLicensed ? "License applied." : "License not applied.");
}
}using IronPrint;
class LicenseCheck
{
static void Main()
{
// Check if the license is applied
bool isLicensed = IronPrint.License.IsLicensed;
Console.WriteLine(isLicensed ? "License applied." : "License not applied.");
}
}Imports IronPrint
Friend Class LicenseCheck
Shared Sub Main()
' Check if the license is applied
Dim isLicensed As Boolean = IronPrint.License.IsLicensed
Console.WriteLine(If(isLicensed, "License applied.", "License not applied."))
End Sub
End ClassImports IronPrint
Friend Class LicenseCheck
Shared Sub Main()
' Check if the license is applied
Dim isLicensed As Boolean = IronPrint.License.IsLicensed
Console.WriteLine(If(isLicensed, "License applied.", "License not applied."))
End Sub
End Class驗證許可證密鑰
為確保您的許可證或試用金鑰的有效性,您可以使用以下程式碼片段:
using IronPrint;
class ValidateLicense
{
static void Main()
{
// Validate license or trial key
bool isValid = IronPrint.License.IsValidLicense("YOUR_LICENSE_KEY");
Console.WriteLine(isValid ? "License key is valid." : "License key is invalid.");
}
}using IronPrint;
class ValidateLicense
{
static void Main()
{
// Validate license or trial key
bool isValid = IronPrint.License.IsValidLicense("YOUR_LICENSE_KEY");
Console.WriteLine(isValid ? "License key is valid." : "License key is invalid.");
}
}Imports IronPrint
Class ValidateLicense
Shared Sub Main()
' Validate license or trial key
Dim isValid As Boolean = IronPrint.License.IsValidLicense("YOUR_LICENSE_KEY")
Console.WriteLine(If(isValid, "License key is valid.", "License key is invalid."))
End Sub
End ClassImports IronPrint
Class ValidateLicense
Shared Sub Main()
' Validate license or trial key
Dim isValid As Boolean = IronPrint.License.IsValidLicense("YOUR_LICENSE_KEY")
Console.WriteLine(If(isValid, "License key is valid.", "License key is invalid."))
End Sub
End Class如果傳回值為True ,則表示該鍵有效,您可以繼續使用 IronPrint。 但是,如果傳回值為False ,則表示該鍵無效。
步驟4:開始您的專案
為了開始使用IronPrint,我們強烈建議您參考我們的全面教學:如何開始使用IronPrint。 本教學提供詳細的說明和範例,幫助您掌握 IronPrint 的基本使用方法。
有任何疑問或需要協助?
要在實時專案中使用IronPrint,您需要付費或試用授權金鑰,您可以通過購買授權來獲得。 訪問此連結即可取得試用授權。
如需代碼範例、教學、授權詳細資訊,以及廣泛的文件,請查看我們網站上的IronPrint部分。
如果您有任何問題,隨時可以聯繫support@ironsoftware.com。
常見問題
如何取得IronPrint的授權金鑰?
您可以從我們的授權頁面購買IronPrint授權金鑰,或註冊免費30天試用金鑰。
如何使用C#程式碼套用IronPrint授權金鑰?
在您的應用程序啟動時包含代碼 IronPrint.License.LicenseKey = "YOUR_LICENSE_KEY";,在使用IronPrint之前,確保您的授權已經應用。
我可以使用Web.Config或App.Config套用IronPrint授權金鑰嗎?
是的,要全局應用它,請在Web.Config或App.Config文件的appSettings部分添加 <add key="IronPrint.LicenseKey" value="YOUR_LICENSE_KEY" />。
如果我的授權金鑰在Web.Config中無效,我應該怎麼做?
針對ASP.NET專案或.NET Framework版本 >= 4.6.2,如果Web.Config中的授權金鑰未被辨識,請參閱『在Web.config中設定授權金鑰』故障排除文章。
如何使用.NET Core appsettings.json文件套用IronPrint授權金鑰?
在您專案的根目錄中創建appsettings.json文件,並設置鍵 "IronPrint.LicenseKey" 的值為您的授權金鑰。確保其設置為複製到輸出目錄。
如何驗證我的IronPrint授權金鑰是否已套用?
使用 IronPrint.License.IsLicensed 來檢查授權是否已應用。如果成功,它應該返回true。
如何驗證我的IronPrint授權金鑰?
利用 IronPrint.License.IsValidLicense("YOUR_LICENSE_KEY") 函數來驗證您的授權或試用金鑰。如果金鑰有效,它將返回true。
我可以在哪裡找到開始使用IronPrint的教學?
要開始使用IronPrint,請參考我們的[IronPrint入門教學](/csharp/print/docs/)以獲取逐步說明和範例。
如果我對IronPrint有疑問或需要支援,我應該怎麼辦?
任何與IronPrint相關的問題或支援需求,歡迎隨時聯繫support@ironsoftware.com。
Curtis Chau 擁有卡爾頓大學計算機科學學士學位,專注於前端開發,擅長於 Node.js、TypeScript、JavaScript 和 React。Curtis 熱衷於創建直觀且美觀的用戶界面,喜歡使用現代框架並打造結構良好、視覺吸引人的手冊。