Thank's for reply
Yes i am able get the local machine printer information with the help
of WMI,
and here is the code :
ManagementScope mgmtscope = new ManagementScope(@"\root
\cimv2");
mgmtscope.Connect();
ManagementObjectSearcher objSearcher = new
ManagementObjectSearcher("Select * from Win32_Printer");
foreach (ManagementObject printer in objSearcher.Get())
{
sysName =
printer["SystemName"].ToString().ToLower();
printerName =
printer["Name"].ToString().ToLower();
}
I also tried
select * from win32_printer where servername = '\\os1'
but still not able to get the printer info on system name os1.
any idea ???
waiting for your reply ..............................
Thank's
Tarun sinha
On Aug 1, 8:08 am, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.comwrote:
Tarun,
What is the query you are using in WMI? Is the printer available from
the local machine, or no? If it is not, then I don't think you can get the
printer information (the WMI providers work on the local machine). I think
you would have to connect to the WMI provider on "os1" and then run the
query there.
--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com
"TARUN" <tarun.si...@gmail.comwrote in message
news:11**********************@d30g2000prg.googlegr oups.com...
Hello all,
Please help and suggest the code to get the printer status over the
network.
for Example, i have an string "\\\\os1\\PtName"
where os1 is the system name
and PtName is the printer name
I need to know the status of this printer on the system name "os1".
Please suggest me the code for that in C#.
I am using WMI but not able to get anything helpful stuff.
Thank's and Regards
Tarun Sinha- Hide quoted text -
- Show quoted text -