c# - 如何判断打印机是否存在?

标签 c# printing

<分区>

Possible Duplicate:
how do i check if a printer is installed and ready using C#?

我用 PDFCreator在 C# 中从我的程序制作 pdf 文件 虽然我有一般错误的异常,但我想知道如何检查打印机本身是否存在于系统中。

类似于文件存在检查。

有这样的选择吗?

最佳答案

使用PrintDialog就可以知道

System.Windows.Forms.PrintDialog dlg=new PrintDialog();
if(dlg.PrinterSettings.IsValid)
      MessageBox.Show("Printer Exist: "+ dlg.PrinterSettings.PrinterName);
else
      MessageBox.Show("Printer Does Not Exist");

关于c# - 如何判断打印机是否存在?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9653589/

相关文章:

c# - 在 finally block 上使用未分配的局部变量

c# - 用户定义的结构和默认(反)序列化

c# - 当现有格式不一致时,如何使电话号码变得漂亮/用户友好?

java - 打印机竞争状况?

c# - .NET PrintDocument - 文本被截断

c# - 如何比较两个对象的属性?

c# - 无法将数组转换为 IEnumerable

html - 打印一个 Bootstrap 网站

printing - 如何将 Mathematica 打印和错误打印重定向到文件?

c# - 在 .Net 中使用 HP laserJet 10xx 进行打印