c#获取全部打印机和默认打印机的方法

using System.Drawing.Printing;        //这是必备

 

 

for (int i = 0; i < PrinterSettings.InstalledPrinters.Count; i++)       //获取当前打印机
{
                comboBox1.Items.Add(PrinterSettings.InstalledPrinters[i])
} comboBox1.SelectedIndex
= 0;

 

PrintDocument fPrintDocument = new PrintDocument();    //获取默认打印机的方法
comboBox1.Text
= fPrintDocument.PrinterSettings.PrinterName;

 

posted @ 2017-08-04 10:32  唐尧  阅读(11837)  评论(0编辑  收藏  举报