プリンター名の取得
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 Private printersName As List(Of String) = Printer.GetPrinterNames() For Each printer In printersName Console.WriteLine(printer) Next printer
Install-Package IronPrint
GetPrinterNames`メソッドを使用して、マシンに接続されている利用可能なプリンタをすべて取得する。このメソッドは文字列データ型のプリンタ名のリストを返す。
10 の .NET API 製品 オフィス文書用