IRONSOFTWAREHOME
取得印表機名稱
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
NuGet Download
PM > Install-Package IronPrint
取得印表機名稱

取得印表機名稱

使用GetPrinterNames方法來檢索連接到機器的所有可用印表機。該方法將返回以字串資料型別表示的印表機名稱列表。

此程式碼片段提供了一種簡單且有效的方式來列出連接到您的機器的所有印表機,這在大型應用程式中進行除錯或管理印表機配置時非常有用。

探索進階印表機設定指南
在 GitHub 上查看

準備好開始了嗎?

Nuget Downloads 46,090版本:2026.9剛剛發布

Key in blue circle

立即免費取得 30 天試用金鑰

Your trial license will be sent to your email address

無任何限制。100% 解鎖。無需信用卡。

bullet_checked無需信用卡或建立帳號無任何限制。100% 解鎖。無需信用卡。
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
預約您的免費
現場演示
Booking Badge

全球數百萬工程師信賴

Iron Software的客戶標誌
獲得非義務性諮詢
完成下列表單或發郵件到sales@ironsoftware.com
您的資訊將始終保密。
全球數百萬工程師信賴
Iron Software的客戶標誌
立即獲取您的30天試用金鑰
無需信用卡或帳戶建立