Pages

Sunday, March 30, 2008

printers connected to your computer

This code sample gets you the list of all connected printers (both local and network printers).

Microsoft.Win32.RegistryKey rk;
rk = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Printers\Settings");
string[] printernames = rk.GetValueNames();
if (printernames.Length > 0)
{
foreach (string s in printernames)
{
{
Console.WriteLine(s);
}
}
}

1 comment:

Anonymous said...

Nice Post..
Your blog is too good. What i like about your blog it has all the flav's of Microsoft Techies...