c#控制打印机杂项

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

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");
}
 
测试结果: 单机好像基本可行 
原文地址:https://www.cnblogs.com/meetweb/p/3394562.html