引用 using System.Drawing.Printing;
PrintDocument prtdoc = new PrintDocument(); private void Form3_Load(object sender, EventArgs e) { 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); } } }