using System.Runtime.InteropServices;
[DllImport("winspool.drv")]
public static extern bool SetDefaultPrinter(stringName);
privatevoid button1_Click(objectsender, EventArgs e)
{
聽聽聽 SetDefaultPrinter("My Printer");
}以上就是C# 如何设置系统的默认打印机的简单代码示例的详细内容,更多请关注php中文网其它相关文章!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号