'需要引用:
Imports System.Drawing.Printing
读取代码如下: Dim prtdoc As New PrintDocument()
Dim strDefaultPrinter As String = prtdoc.PrinterSettings.PrinterName '读取的是默认打印机名称
Dim strPrinter As [String]
For Each strPrinter In PrinterSettings.InstalledPrinters '循环例出所有打印机名称
Next
strPrinter.PaperName '打印机的纸张名称(类型)
strPrinter.Width '纸张的宽度
strPrinter.Height '纸张的高度
本文介绍了如何使用C#代码获取并操作打印机的详细信息,包括读取默认打印机名称、循环列出所有打印机名称及其纸张名称、宽度和高度。
3454

被折叠的 条评论
为什么被折叠?



