因项目中需要用到控制打印机的相关信息,此贴将网络寻找的资料做了些整理

 

1. C# 如何设置系统的默认打印机

using System.Runtime.InteropServices;
 
[DllImport("winspool.drv")]
public static extern bool SetDefaultPrinter(string Name);
 
private void button1_Click(object sender, EventArgs e)
{
    SetDefaultPrinter("My Printer");
}
 
测试结果: 单机好像基本可行 

相关文章:

  • 2021-09-09
  • 2021-11-22
  • 2022-01-29
  • 2021-04-23
  • 2022-12-23
  • 2021-12-23
  • 2022-01-19
  • 2022-02-07
猜你喜欢
  • 2022-03-08
  • 2021-11-30
  • 2021-12-25
  • 2022-02-21
  • 2022-12-23
  • 2022-03-03
  • 2022-01-22
相关资源
相似解决方案