引用 using System.Drawing.Printing;
//代码
PrintDocument prtdoc = new PrintDocument();
string strDefaultPrinter = prtdoc.PrinterSettings.PrinterName;//获取默认的打印机名
foreach (string ss in PrinterSettings.InstalledPrinters)
{
///在列表框中列出所有的打印机,
this.listBox1.Items.Add(ss);
if (ss == strDefaultPrinter)//把默认打印机设为缺省值
{
listBox1.SelectedIndex = listBox1.Items.IndexOf(ss);
}
}