从C Sharp应用程序使用特定的打印机打印文档

问题描述:

在我的机器上,连接了两台打印机,我想使用其中一台打印机从c Sharp应用程序中打印图像,而不提示打印对话框窗口.我可以通过编程方式选择要打印的打印机而不将其设置为默认打印机吗?
请帮助....

In my machine two printers are connected, I want to print an image from from my c sharp application using one of the printer without prompting the print dialog window. can i select programatically my printer for printing without setting it as default printer?
plz help..........

PrintDocument pd = new PrintDocument();
pd.PrinterSettings.PrinterName =打印机名称";

if(pd.PrinterSettings.IsValid)
pd.Print();
其他
MessageBox.Show(打印机无效.");
PrintDocument pd = new PrintDocument();
pd.PrinterSettings.PrinterName = "printername";

if(pd.PrinterSettings.IsValid)
pd.Print();
else
MessageBox.Show("Printer is invalid.");