[DllImport("winspool.drv",CharSet=CharSet.Auto,SetLastError =true)]public static extern bool SetDefaultPrinter(string Name);
试试看这个代码:https://blog.csdn.net/daone/article/details/42487655另外,检查下程序是否有权限,用管理员方式运行最后,看看是不是系统有打印机,你设置的打印机名字是不是写错了。