Hi all,
I want to write code in C# for loading printer name in window. But I don't have any ideas to write it.
Can anybody help me to solve this problem?
Thanks. Ung Sopolin
Hi all,
I want to write code in C# for loading printer name in window. But I don't have any ideas to write it.
Can anybody help me to solve this problem?
Thanks. Ung Sopolin
Include a reference to the System.Drawing
library and then:
var printers = PrinterSettings.InstalledPrinters.Cast<string>();
foreach (var printer in printers)
{
Console.WriteLine(printer);
}
I think you might be interested in this post.
Use PrinterSettings class from the System.Drawing.Printing namespace
PrinterSettings.InstalledPrinters
should return you a list of Printers.
PrinterSettings prSetting = new PrinterSettings();
Then prSetting.PrinterName will get you the name of the default printer name. You can use the same class for other Printer information.