winform设置默认打印机

/// <summary>
/// 设置默认打印机
/// </summary>
public class Externs
{
[DllImport("winspool.drv")]
public static extern bool SetDefaultPrinter(String Name); //调用win api将指定名称的打印机设置为默认打印机
}

Externs.SetDefaultPrinter("Microsoft Shared Fax Driver");

posted on 2019-08-15 10:45  Smile向前  阅读(597)  评论(0编辑  收藏  举报