/ Published in: C#
Amazingly fast. Doesn't throw exceptions if the printer doesn't exist.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
public bool IsValid { get { bool retVal = false; try { pd.PrinterSettings.PrinterName = printerName; retVal = pd.PrinterSettings.IsValid; } catch(System.Exception ex) { string errorMsg = ""; errorMsg = "Printer Error:" + printerName + ex.ToString(); Trace.WriteLine(errorMsg); retVal = false; } return retVal; } }