https://blog.csdn.net/weixin_38211198/article/details/89740286

不过这个分享不能赋值,正的麻烦,所以我拷贝过来了

该方法只能再Windows 电脑下有用。

列出所有打印机

using System.Drawing.Printing;//这句是需要引用

foreach (var item in PrinterSettings.InstalledPrinters)
{
    Console.WriteLine(item);
}
Console.ReadKey();

https://www.cnblogs.com/erph/p/7283682.html

下面的方法是参考了这个博客,虽然他的可以赋值,但是自己也保留一份吧,怕她万一那天删了,就什么都没有了

获取默认打印机的方法

PrintDocument fPrintDocument = new PrintDocument();    //获取默认打印机的方法

comboBox1.Text = fPrintDocument.PrinterSettings.PrinterName;

相关文章:

  • 2022-12-23
  • 2021-08-21
  • 2022-12-23
  • 2021-07-28
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-14
  • 2022-12-23
  • 2021-12-08
  • 2022-12-23
  • 2021-08-26
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案