0

I am working on web application .net 3.5,asp.net,C#. In that i need to provide list of available printer at client side.

I have knowledge of how to get server side printers using

[1] System.Drawing.Printing.PrinterSettings.InstalledPrinters

[2] System.Management.ManagementObjectSearcher [using query "SELECT * FROM Win32_Printer"]

But this all regarding server side, my requirement is to get client side installed printers.

after some searching i come to know i can do this by active X control. but how?

Is there any other way to get list of client side printers?

Prompt reply will be appreciated.

Thank you

Mike
  • 317
  • 3
  • 7
  • 17
  • Active X control is probably your only route. This type of low level access is generally blocked by browsers for security. – Tim Santeford Oct 01 '09 at 04:45
  • Thanks for the reply, but how ? i don't know how to do access activeX control of printer .. – Mike Oct 01 '09 at 04:46

1 Answers1

0

Here the trick

var oShell = new ActiveXObject("WScript.Shell"); 
sReg = 'HKEY_CURRENT_USER\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows\\Device'
var sName = oShell.RegRead(sRegVal)
document.write(sName);

As Tim stanteford said, this method only works with IE and might not work as expected if security permission is high.

RameshVel
  • 64,778
  • 30
  • 169
  • 213