マシンに接続されたすべての利用可能なプリンターを取得するには、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)
NextImports 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ダウンロード数 52,427|バージョン:2026.11ちょうどリリースされました
文書を印刷する必要がある場合は、迅速に。