I have my web page published in hosting, and I cant print my reports because (I tink) my web application can`t get my printer name.
An Idea please.
Thanks a lot.
使用 web 配置文件来设置您的打印机名称。在打印机设置中使用此名称。
<add key="PrinterName" value="\\192.168.1.1\Canon LBP6000/LBP6018" />
在c#中
PrintDocument printDoc = new PrintDocument();
string printerName = WebConfigurationManager.AppSettings["PrinterName"];
printDoc.PrinterSettings.PrinterName = printerName;
确实为我工作。