使用GetPrinterNames方法來檢索連接到機器的所有可用印表機。該方法將返回以字串資料型別表示的印表機名稱列表。
此程式碼片段提供了一種簡單且有效的方式來列出連接到您的機器的所有印表機,這在大型應用程式中進行除錯或管理印表機配置時非常有用。
探索進階印表機設定指南using IronPrint;
using System;
using System.Collections.Generic;
// Retrieve printers' name
List<string> printersName = Printer.GetPrinterNames();
foreach (var printer in printersName)
{
Console.WriteLine(printer);
}
Imports IronPrint
Imports System
Imports System.Collections.Generic
' Retrieve printers' name
Dim printersName As List(Of String) = Printer.GetPrinterNames()
For Each printer In printersName
Console.WriteLine(printer)
Next使用GetPrinterNames方法來檢索連接到機器的所有可用印表機。該方法將返回以字串資料型別表示的印表機名稱列表。
此程式碼片段提供了一種簡單且有效的方式來列出連接到您的機器的所有印表機,這在大型應用程式中進行除錯或管理印表機配置時非常有用。
探索進階印表機設定指南Nuget Downloads 46,090|版本:2026.9剛剛發布