C#獲取本地打印機列表,並將指定打印機設置為默認打印機
LocalPrinter.cs Externs.cs ...
LocalPrinter.cs Externs.cs ...
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Syste ...
引用 using System.Drawing.Printing; ...
一:獲得本地安裝的打印機列表 注:(如果在“設備和打印機”中已經添加了局域網的打印機設備,也算是本地安裝的打印機;沒有添加的則算作局域網打印機) 1,通過 C# 中 PrinterSettings 對象獲取,如下,然后通過 foreach 即可遍歷 printers ...
網上打了很多方法都無效,以下方法在WIN7pro中測試可用: Sub QQ1722187970() MsgBox "當前默認的打印機名稱為" & Excel.Application.ActivePrinter End Sub 通過直接使用WMI來獲取 ...
代碼。 首先是加載本地打印機的類LocalPrinter 然后是調用windows ...
獲取當前設置能使用的打印機: 獲取所有的打印機 獲取打印機下的紙盒: 獲取打印機下的紙盒 打印圖片方法: 打印圖片 注冊打印方法: 注冊打印 ...
List<string> print = Cprinter.GetLocalPrinter(); View Code ...