本文摘自PHP中文网,作者黄舟,侵删。
C# 如何设置系统的默认打印机的简单代码示例
1 2 3 4 5 6 7 | using System.Runtime.InteropServices;
[DllImport( "winspool.drv" )]
public static extern bool SetDefaultPrinter(stringName);
privatevoid button1_Click(objectsender, EventArgs e)
{
??? SetDefaultPrinter( "My Printer" );
}
|
以上就是C# 如何设置系统的默认打印机的简单代码示例的详细内容!
相关阅读 >>
C#中static void main(string[] args) 参数的示例代码详解
C#泛型类型的详细介绍
C#中正则表达式有什么作用?匹配字符有什么含义?
C#解析xml文件的代码实例分享
C#获取listview鼠标下的item案例
C#使用webclient登录网站并抓取登录后的网页信息实现方法
具体介绍C#编程获取ip地址的方法
C#中关于manualresetevent使用方法详解
详解C#中timer的使用和解决重入问题
C#系列文章事件
更多相关阅读请进入《C#》频道 >>
清华大学出版社
作者:[美]克里斯琴·内格尔(Christian Nagel)著。出版时间:2019年3月。
转载请注明出处:木庄网络博客 » C# 如何设置系统的默认打印机的简单代码示例