PrintQueue is the printer the default printer?

2019-07-21 20:47发布

I'm making my own dialog for printing in my application, now I have this code to put all the printers in a combobox:

        PrintServer server = new PrintServer();

        foreach (PrintQueue queue in server.GetPrintQueues())
        {
            cboPrinters.Items.Add(queue.FullName);
        }

However, I would need select the default printer, how can I see which one is the default printer?

2条回答
虎瘦雄心在
2楼-- · 2019-07-21 20:56
冷血范
3楼-- · 2019-07-21 21:01
var DefaultPrinter = new LocalPrintServer().DefaultPrintQueue;
查看更多
登录 后发表回答