.NET幫助 Hangfire .NET Core(開發者的工作原理) Curtis Chau 更新日期:7月 28, 2025 Download IronPDF NuGet 下載 DLL 下載 Windows 安裝程式 Start Free Trial Copy for LLMs Copy for LLMs Copy page as Markdown for LLMs Open in ChatGPT Ask ChatGPT about this page Open in Gemini Ask Gemini about this page Open in Grok Ask Grok about this page Open in Perplexity Ask Perplexity about this page Share Share on Facebook Share on X (Twitter) Share on LinkedIn Copy URL Email article 現代應用程式開發通常需要處理背景任務以應對龐大的工作負載。 在這種情況下,我們需要具備執行多個任務的背景作業處理器。 其中一種用於C# .NET Core應用程式的背景作業處理器是Hangfire。在這篇博客中,我們將學習如何管理Hangfire背景作業以及如何將其與其他套件(如<a href=">IronPDF for PDF Generation)結合使用,以在背景中生成PDF文檔。 Hangfire通過提供可靠且靈活的框架以管理和執行背景任務,簡化了在ASP.NET Core或.NET Core 6 Web API應用程式中的背景處理實現。 Hangfire作為一個NuGet套件提供,您可以使用.NET CLI按如下所示安裝它: dotnet add package Hangfire --version 1.8.6 .NET Core Web API中的實現 為了了解Hangfire,讓我們創建一個簡單的.NET Core API應用程式並使用CLI安裝Hangfire。 dotnet new webapi -n HangfireDemo cd HangfireDemo dotnet build dotnet add package Hangfire --version 1.8.6 dotnet build dotnet new webapi -n HangfireDemo cd HangfireDemo dotnet build dotnet add package Hangfire --version 1.8.6 dotnet build SHELL 在這裡,我們使用.NET CLI創建了一個簡單的天氣REST API。 第一行程式碼創建一個名為HangfireDemo的.NET Core Web API專案來執行API端點。 第二行程式碼導航到我們新創建的資料夾“HangfireDemo”,然後我們構建專案。 接下來,我們將Hangfire NuGet套件添加到我們的專案中,然後再次構建它。 完成這一步之後,您可以在任何您選擇的編輯器中打開您的專案,例如Visual Studio 2022或JetBrains Rider。 如今,如果您執行專案,您可以看到如下的Swagger: 在這裡,我們可以看到返回日期、摘要和溫度的天氣GET API。 現在讓我們添加一個Hangfire背景作業處理器。 在Visual Studio中開啟專案。 添加Hangfire作業處理器 在您的應用程式中配置Hangfire,通常是在Startup.cs檔案中。這包括建立作業存儲和初始化Hangfire服務器。 // Startup.cs using Hangfire; public class Startup { public void ConfigureServices(IServiceCollection services) { // Add Hangfire services and use SQL Server as storage option services.AddHangfire(config => config.UseSqlServerStorage("your_connection_string")); services.AddHangfireServer(); } public void Configure(IApplicationBuilder app, IHostingEnvironment env) { // Use Hangfire Server and Dashboard for monitoring and managing jobs app.UseHangfireServer(); app.UseHangfireDashboard(); // Your other configuration settings } } // Startup.cs using Hangfire; public class Startup { public void ConfigureServices(IServiceCollection services) { // Add Hangfire services and use SQL Server as storage option services.AddHangfire(config => config.UseSqlServerStorage("your_connection_string")); services.AddHangfireServer(); } public void Configure(IApplicationBuilder app, IHostingEnvironment env) { // Use Hangfire Server and Dashboard for monitoring and managing jobs app.UseHangfireServer(); app.UseHangfireDashboard(); // Your other configuration settings } } ' Startup.cs Imports Hangfire Public Class Startup Public Sub ConfigureServices(ByVal services As IServiceCollection) ' Add Hangfire services and use SQL Server as storage option services.AddHangfire(Function(config) config.UseSqlServerStorage("your_connection_string")) services.AddHangfireServer() End Sub Public Sub Configure(ByVal app As IApplicationBuilder, ByVal env As IHostingEnvironment) ' Use Hangfire Server and Dashboard for monitoring and managing jobs app.UseHangfireServer() app.UseHangfireDashboard() ' Your other configuration settings End Sub End Class $vbLabelText $csharpLabel ConfigureServices方法用於添加存儲以保存Hangfire的新建作業。 在此使用到了SQL Server資料庫。 SQL Server連接字串應替換為“your_connection_string”。 也可以使用Hangfire.InMemory進行內存中存儲。 dotnet add package Hangfire.InMemory --version 0.6.0 並替換為: services.AddHangfire(configuration => { configuration.UseInMemoryStorage(); }); services.AddHangfire(configuration => { configuration.UseInMemoryStorage(); }); services.AddHangfire(Sub(configuration) configuration.UseInMemoryStorage() End Sub) $vbLabelText $csharpLabel 創建背景作業 定義您想要作為背景任務運行的方法。 這些方法應該是擁有無參數構造函數的類的靜態方法或實例方法。 作業可以作為定期作業運行,或者您可以同時運行多個作業。 public class MyBackgroundJob { public void ProcessJob() { // Background job logic, can be a recurring job or multiple jobs Console.WriteLine("Background job is running..."); } } public class MyBackgroundJob { public void ProcessJob() { // Background job logic, can be a recurring job or multiple jobs Console.WriteLine("Background job is running..."); } } Public Class MyBackgroundJob Public Sub ProcessJob() ' Background job logic, can be a recurring job or multiple jobs Console.WriteLine("Background job is running...") End Sub End Class $vbLabelText $csharpLabel 排隊作業 使用Hangfire API來排隊背景作業。 您可以排程背景作業在特定時間運行、延遲後運行或定期運行。 // Enqueue a job to run immediately BackgroundJob.Enqueue<MyBackgroundJob>(x => x.ProcessJob()); // Schedule a job to run after a 5-minute delay BackgroundJob.Schedule<MyBackgroundJob>(x => x.ProcessJob(), TimeSpan.FromMinutes(5)); // Schedule a recurring job using a job ID RecurringJob.AddOrUpdate<MyBackgroundJob>("jobId", x => x.ProcessJob(), Cron.Daily); // Enqueue a job to run immediately BackgroundJob.Enqueue<MyBackgroundJob>(x => x.ProcessJob()); // Schedule a job to run after a 5-minute delay BackgroundJob.Schedule<MyBackgroundJob>(x => x.ProcessJob(), TimeSpan.FromMinutes(5)); // Schedule a recurring job using a job ID RecurringJob.AddOrUpdate<MyBackgroundJob>("jobId", x => x.ProcessJob(), Cron.Daily); ' Enqueue a job to run immediately BackgroundJob.Enqueue(Of MyBackgroundJob)(Function(x) x.ProcessJob()) ' Schedule a job to run after a 5-minute delay BackgroundJob.Schedule(Of MyBackgroundJob)(Function(x) x.ProcessJob(), TimeSpan.FromMinutes(5)) ' Schedule a recurring job using a job ID RecurringJob.AddOrUpdate(Of MyBackgroundJob)("jobId", Function(x) x.ProcessJob(), Cron.Daily) $vbLabelText $csharpLabel Hangfire儀錶板和服務器 可以在Configure方法中添加Hangfire儀錶板和服務器以進行實時作業監控。 // Run Hangfire server and dashboard app.UseHangfireServer(); app.UseHangfireDashboard(); // Run Hangfire server and dashboard app.UseHangfireServer(); app.UseHangfireDashboard(); ' Run Hangfire server and dashboard app.UseHangfireServer() app.UseHangfireDashboard() $vbLabelText $csharpLabel 服務器也可以添加在ConfigureServices中。 services.AddHangfireServer(); services.AddHangfireServer(); services.AddHangfireServer() $vbLabelText $csharpLabel 一次性作業 // Fire and forget jobs are executed only once and almost immediately after creation. var jobId = BackgroundJob.Enqueue(() => Console.WriteLine("Fire-and-forget!")); // Job ID for fire and forget job // Fire and forget jobs are executed only once and almost immediately after creation. var jobId = BackgroundJob.Enqueue(() => Console.WriteLine("Fire-and-forget!")); // Job ID for fire and forget job ' Fire and forget jobs are executed only once and almost immediately after creation. Dim jobId = BackgroundJob.Enqueue(Sub() Console.WriteLine("Fire-and-forget!")) ' Job ID for fire and forget job $vbLabelText $csharpLabel 定期作業 // Recurring jobs fire many times based on a specified CRON schedule. RecurringJob.AddOrUpdate("myrecurringjob", () => Console.WriteLine("Recurring!"), Cron.Daily); // Recurring jobs fire many times based on a specified CRON schedule. RecurringJob.AddOrUpdate("myrecurringjob", () => Console.WriteLine("Recurring!"), Cron.Daily); ' Recurring jobs fire many times based on a specified CRON schedule. RecurringJob.AddOrUpdate("myrecurringjob", Sub() Console.WriteLine("Recurring!"), Cron.Daily) $vbLabelText $csharpLabel 延遲作業 // Delayed jobs are executed only once but after a specified interval. var jobId = BackgroundJob.Schedule(() => Console.WriteLine("Delayed!"), TimeSpan.FromDays(7)); // Delayed jobs are executed only once but after a specified interval. var jobId = BackgroundJob.Schedule(() => Console.WriteLine("Delayed!"), TimeSpan.FromDays(7)); ' Delayed jobs are executed only once but after a specified interval. Dim jobId = BackgroundJob.Schedule(Sub() Console.WriteLine("Delayed!"), TimeSpan.FromDays(7)) $vbLabelText $csharpLabel 繼續作業 // Continuation jobs are executed once their parent jobs have completed. BackgroundJob.ContinueJobWith(jobId, () => Console.WriteLine("Continuation!")); // Continuation jobs are executed once their parent jobs have completed. BackgroundJob.ContinueJobWith(jobId, () => Console.WriteLine("Continuation!")); ' Continuation jobs are executed once their parent jobs have completed. BackgroundJob.ContinueJobWith(jobId, Sub() Console.WriteLine("Continuation!")) $vbLabelText $csharpLabel 批次作業 // Batch is a group of background jobs created atomically and considered as a single entity. var batchId = BatchJob.StartNew(x => { x.Enqueue(() => Console.WriteLine("Job 1")); x.Enqueue(() => Console.WriteLine("Job 2")); }); // Batch is a group of background jobs created atomically and considered as a single entity. var batchId = BatchJob.StartNew(x => { x.Enqueue(() => Console.WriteLine("Job 1")); x.Enqueue(() => Console.WriteLine("Job 2")); }); ' Batch is a group of background jobs created atomically and considered as a single entity. Dim batchId = BatchJob.StartNew(Sub(x) x.Enqueue(Sub() Console.WriteLine("Job 1")) x.Enqueue(Sub() Console.WriteLine("Job 2")) End Sub) $vbLabelText $csharpLabel 批次繼續作業 // Batch continuation is fired when all background jobs in a parent batch are finished. BatchJob.ContinueBatchWith(batchId, x => { x.Enqueue(() => Console.WriteLine("Last Job")); }); // Batch continuation is fired when all background jobs in a parent batch are finished. BatchJob.ContinueBatchWith(batchId, x => { x.Enqueue(() => Console.WriteLine("Last Job")); }); ' Batch continuation is fired when all background jobs in a parent batch are finished. BatchJob.ContinueBatchWith(batchId, Sub(x) x.Enqueue(Sub() Console.WriteLine("Last Job")) End Sub) $vbLabelText $csharpLabel 儀錶板 Hangfire儀錶板是您可以找到所有關於您背景任務的資訊的地方。 它是作為一個OWIN中間件編寫的(如果您不熟悉OWIN,不用擔心),因此您可以將它插入到您的ASP.NET、ASP.NET MVC、Nancy和ServiceStack應用,以及使用OWIN自託管功能來在控制台應用或Windows服務中託管儀錶板。 當您啟用了儀錶板後,它在/hangfire/擴展中可以使用。 在此儀錶板中,您可以管理運行中的背景作業、排程背景作業以及查看一次性作業和定期作業。 作業可以通過一個作業ID來識別。 實時處理 成功的作業 查看下面成功的作業。 排程作業 當您的應用程式運行時,Hangfire將根據配置的設置來處理背景作業。 Remember to check the Hangfire documentation for more advanced configuration options and features: Hangfire Documentation and complete code can be found on GitHub Hangfire Demo. Introducing IronPDF IronPDF for .NET PDF Generation is a NuGet package from NuGet套件,幫助讀取和生成PDF文檔。 它可以將容易格式化的文檔與樣式資訊輕鬆轉換為PDF。 IronPDF可以輕鬆從HTML內容生成PDF。 它可以從URL下載HTML,然後生成PDF。 IronPDF的主要優勢是其HTML到PDF轉換功能,它能夠保留佈局和樣式。 它可以從網頁內容創建PDF,這對於報告、發票和文檔非常理想。 using IronPdf; class Program { static void Main(string[] args) { var renderer = new ChromePdfRenderer(); // Convert HTML String to PDF var htmlContent = "<h1>Hello, IronPDF!</h1><p>This is a PDF from an HTML string.</p>"; var pdfFromHtmlString = renderer.RenderHtmlAsPdf(htmlContent); pdfFromHtmlString.SaveAs("HTMLStringToPDF.pdf"); // Convert HTML File to PDF var htmlFilePath = "path_to_your_html_file.html"; // Specify the path to your HTML file var pdfFromHtmlFile = renderer.RenderHtmlFileAsPdf(htmlFilePath); pdfFromHtmlFile.SaveAs("HTMLFileToPDF.pdf"); // Convert URL to PDF var url = "http://ironpdf.com"; // Specify the URL var pdfFromUrl = renderer.RenderUrlAsPdf(url); pdfFromUrl.SaveAs("URLToPDF.pdf"); } } using IronPdf; class Program { static void Main(string[] args) { var renderer = new ChromePdfRenderer(); // Convert HTML String to PDF var htmlContent = "<h1>Hello, IronPDF!</h1><p>This is a PDF from an HTML string.</p>"; var pdfFromHtmlString = renderer.RenderHtmlAsPdf(htmlContent); pdfFromHtmlString.SaveAs("HTMLStringToPDF.pdf"); // Convert HTML File to PDF var htmlFilePath = "path_to_your_html_file.html"; // Specify the path to your HTML file var pdfFromHtmlFile = renderer.RenderHtmlFileAsPdf(htmlFilePath); pdfFromHtmlFile.SaveAs("HTMLFileToPDF.pdf"); // Convert URL to PDF var url = "http://ironpdf.com"; // Specify the URL var pdfFromUrl = renderer.RenderUrlAsPdf(url); pdfFromUrl.SaveAs("URLToPDF.pdf"); } } Imports IronPdf Friend Class Program Shared Sub Main(ByVal args() As String) Dim renderer = New ChromePdfRenderer() ' Convert HTML String to PDF Dim htmlContent = "<h1>Hello, IronPDF!</h1><p>This is a PDF from an HTML string.</p>" Dim pdfFromHtmlString = renderer.RenderHtmlAsPdf(htmlContent) pdfFromHtmlString.SaveAs("HTMLStringToPDF.pdf") ' Convert HTML File to PDF Dim htmlFilePath = "path_to_your_html_file.html" ' Specify the path to your HTML file Dim pdfFromHtmlFile = renderer.RenderHtmlFileAsPdf(htmlFilePath) pdfFromHtmlFile.SaveAs("HTMLFileToPDF.pdf") ' Convert URL to PDF Dim url = "http://ironpdf.com" ' Specify the URL Dim pdfFromUrl = renderer.RenderUrlAsPdf(url) pdfFromUrl.SaveAs("URLToPDF.pdf") End Sub End Class $vbLabelText $csharpLabel 開始使用 IronPDF 安裝IronPDF庫 通過 NuGet 包管理器安裝 要在您的Hangfire .NET專案中整合IronPDF,使用NuGet包管理員請按以下步驟操作: 打開Visual Studio,在解決方案資源管理器中,右鍵點擊您的專案。 從上下文菜單中選擇“管理NuGet包…”。 前往瀏覽選項卡,搜尋IronPDF。 從搜尋結果中選擇IronPDF庫,然後點擊安裝按鈕。 接受任何許可協議提示。 如果您偏好使用包管理器控制台,執行以下命令: Install-Package IronPdf 這將獲取並將IronPDF安裝到您的專案中。 通過 NuGet 網站安裝 關於IronPDF的詳細概述,包括功能、相容性和其他下載選項,請訪問NuGet網站上的IronPDF頁面:https://www.nuget.org/packages/IronPdf。 通過 DLL 安裝 或者,您可以直接將 IronPDF 集成到項目中,使用其 DLL 文件。從此處下載包含 DLL 的 ZIP 文件 IronPDF 直接下載。 解壓縮並將 DLL 包含在您的項目中。 現在讓我們修改我們的應用程式以添加一個下載網站為PDF檔的背景處理作業。 namespace HangfireDemo.Core; public class PdfGenerationJob { public void Start(string website) { // Create a PDF from any existing web page ChromePdfRenderer renderer = new ChromePdfRenderer(); PdfDocument pdf = renderer.RenderUrlAsPdf(website); var filePath = AppContext.BaseDirectory + "result.pdf"; pdf.SaveAs(filePath); } } namespace HangfireDemo.Core; public class PdfGenerationJob { public void Start(string website) { // Create a PDF from any existing web page ChromePdfRenderer renderer = new ChromePdfRenderer(); PdfDocument pdf = renderer.RenderUrlAsPdf(website); var filePath = AppContext.BaseDirectory + "result.pdf"; pdf.SaveAs(filePath); } } Namespace HangfireDemo.Core Public Class PdfGenerationJob Public Sub Start(ByVal website As String) ' Create a PDF from any existing web page Dim renderer As New ChromePdfRenderer() Dim pdf As PdfDocument = renderer.RenderUrlAsPdf(website) Dim filePath = AppContext.BaseDirectory & "result.pdf" pdf.SaveAs(filePath) End Sub End Class End Namespace $vbLabelText $csharpLabel IronPDF具有一個內建方法,從URL下載網站並將其保存為PDF文檔。 我們將在我們的作業中使用這個方法來下載並保存到指定的位置。 這個背景作業可以修改以接受多個網站URL並將其保存為PDF。 現在,讓我們添加一個控制器來公開PDF生成和下載API。 using Hangfire; using HangfireDemo.Core; using Microsoft.AspNetCore.Mvc; namespace HangfireDemo.Controllers; [ApiController] [Route("[controller]")] public class PdfGeneratorController : ControllerBase { [HttpGet("request", Name = "Start PDF Generation")] public void Start([FromQuery] string websiteUrl) { BackgroundJob.Enqueue<PdfGenerationJob>(x => x.Start(websiteUrl)); } [HttpGet("result", Name = "Download PDF Generation")] public IActionResult WebResult() { var filePath = AppContext.BaseDirectory + "result.pdf"; var stream = new FileStream(filePath, FileMode.Open); return new FileStreamResult(stream, "application/octet-stream") { FileDownloadName = "website.pdf" }; } } using Hangfire; using HangfireDemo.Core; using Microsoft.AspNetCore.Mvc; namespace HangfireDemo.Controllers; [ApiController] [Route("[controller]")] public class PdfGeneratorController : ControllerBase { [HttpGet("request", Name = "Start PDF Generation")] public void Start([FromQuery] string websiteUrl) { BackgroundJob.Enqueue<PdfGenerationJob>(x => x.Start(websiteUrl)); } [HttpGet("result", Name = "Download PDF Generation")] public IActionResult WebResult() { var filePath = AppContext.BaseDirectory + "result.pdf"; var stream = new FileStream(filePath, FileMode.Open); return new FileStreamResult(stream, "application/octet-stream") { FileDownloadName = "website.pdf" }; } } Imports Hangfire Imports HangfireDemo.Core Imports Microsoft.AspNetCore.Mvc Namespace HangfireDemo.Controllers <ApiController> <Route("[controller]")> Public Class PdfGeneratorController Inherits ControllerBase <HttpGet("request", Name := "Start PDF Generation")> Public Sub Start(<FromQuery> ByVal websiteUrl As String) BackgroundJob.Enqueue(Of PdfGenerationJob)(Function(x) x.Start(websiteUrl)) End Sub <HttpGet("result", Name := "Download PDF Generation")> Public Function WebResult() As IActionResult Dim filePath = AppContext.BaseDirectory & "result.pdf" Dim stream = New FileStream(filePath, FileMode.Open) Return New FileStreamResult(stream, "application/octet-stream") With {.FileDownloadName = "website.pdf"} End Function End Class End Namespace $vbLabelText $csharpLabel 這裡我們創建了兩個API:一個啟動背景作業並接收網站URL以開始下載,另一個API下載生成的PDF。 API如下圖所示。 結果如下所示: 許可(可用免費試用) 為了以上代碼能夠無水印運行,需要一個授權金鑰。 註冊IronPDF免費試用可獲得開發者的試用許可。 試用許可不需要信用卡。 您可以提供您的電子郵件ID並註冊免費試用。 結論 Hangfire和IronPDF一起是一個在背景中生成和下載PDF的絕佳組合。 Hangfire可以高效處理長時間運行的任務,而IronPDF為PDF生成提供了一個靈活且易用的解決方案。 若想了解更多IronPDF資訊,您可以訪問IronPDF文件。 還可以探索其他來自Iron Software產品套件的工具,這些工具可以提高您的編碼技能並滿足現代應用程式需求。 常見問題解答 什麼是 .NET Core 中的 Hangfire? Hangfire 是一個框架,簡化了在 ASP.NET Core 或 .NET Core 6 應用程式中實現背景處理的過程。它提供了一個可靠且靈活的方案,用於管理和執行背景工作。 如何在 .NET Core 應用程式中安裝 Hangfire? Hangfire 可以作為 NuGet 套件安裝。您可以使用 .NET CLI 添加它,指令為:dotnet add package Hangfire --version 1.8.6。 Hangfire 支援哪些類型的背景工作? Hangfire 支援各種背景工作類型,包括即時工作、延遲工作、定期工作和續作工作。 如何在 .NET Core 應用程式中配置 Hangfire? Hangfire 規範在 Startup.cs 文件中,在此您設置工作儲存並初始化 Hangfire 伺服器。通常涉及添加 Hangfire 服務並設置 SQL Server 或記憶體儲存。 什麼是 Hangfire 控制台? Hangfire 控制板是一個用於監控和管理背景工作的平台。它提供有關實時處理、已成功完成的工作和計劃中工作的資訊,可通過網頁界面訪問。 如何使用 Hangfire 創建背景工作? 可以通過在 Hangfire 中定義您想運行的方法並使用 Hangfire API 排隊他們來創建背景工作。工作可以立即安排、延遲後或定期運行。 如何在 .NET Core 中執行 PDF 生成任務於背景? 您可以通過支持 HTML 到 PDF 轉換的 PDF 庫在背景中執行 PDF 生成任務。這可以集成到像 Hangfire 這樣的背景工作處理框架中,以自動化從 HTML 內容生成 PDF。 在 .NET 中 PDF 生成庫有什麼功能? PDF 生成庫可以將 HTML 字串、HTML 文件和 URL 轉換為 PDF。它保留布局和樣式,對於生成報告、發票和從網頁內容建立的文檔非常有用。 如何在 .NET 專案中安裝 PDF 生成庫? 可以通過 Visual Studio 中的 NuGet 套件管理器或通過套件管理器控制台以特定命令來安裝 PDF 生成庫。也可以通過從庫網站下載 DLL 直接安裝。 使用無浮水印的 PDF 生成庫需要什麼? 要使用無浮水印的 PDF 生成庫,通常需要授權密鑰。可以通過在庫網站註冊獲得免費試用授權。 如何將 PDF 生成工具與 .NET Core 中的 Hangfire 集成? 可以通過建立使用 PDF 生成庫的背景工作將 PDF 生成工具與 .NET Core 中的 Hangfire 集成,這允許在應用程式中自動化文檔創建和管理。 Curtis Chau 立即與工程團隊聊天 技術作家 Curtis Chau 擁有卡爾頓大學計算機科學學士學位,專注於前端開發,擅長於 Node.js、TypeScript、JavaScript 和 React。Curtis 熱衷於創建直觀且美觀的用戶界面,喜歡使用現代框架並打造結構良好、視覺吸引人的手冊。除了開發之外,Curtis 對物聯網 (IoT) 有著濃厚的興趣,探索將硬體和軟體結合的創新方式。在閒暇時間,他喜愛遊戲並構建 Discord 機器人,結合科技與創意的樂趣。 相關文章 更新日期 9月 4, 2025 RandomNumberGenerator C# 使用RandomNumberGenerator C#類可以幫助將您的PDF生成和編輯項目提升至新水準 閱讀更多 更新日期 9月 4, 2025 C#字符串等於(它如何對開發者起作用) 當結合使用強大的PDF庫IronPDF時,開關模式匹配可以讓您構建更智能、更清晰的邏輯來進行文檔處理 閱讀更多 更新日期 8月 5, 2025 C#開關模式匹配(對開發者來說是如何工作的) 當結合使用強大的PDF庫IronPDF時,開關模式匹配可以讓您構建更智能、更清晰的邏輯來進行文檔處理 閱讀更多 C# 空合併(開發者的工作原理)C# 隊列(開發者的工作原理)