T
trint
Here is the error:
An unhandled exception of type 'System.Management.ManagementException'
occurred in system.management.dll
Additional information: Not found
here is the code:
string printerName = "";
foreach (ManagementObject printer in searcher.Get())
{
printerName = printer["Name"].ToString().ToLower();
if (printerName.Equals(@"\\web1\shipping1"))
{
//Console.WriteLine("Printer = " + printer["Name"]);
error occurs here>>> if
(printer["WorkOffline"].ToString().ToLower().Equals("true"))
{
//Class1.printerStatus = printer;
// printer is offline by user
// Console.WriteLine("Your Plug-N-Play printer is not
connected.");
}
else
{
// printer is not offline
// Console.WriteLine("Your Plug-N-Play printer is connected.");
}
}
}
An unhandled exception of type 'System.Management.ManagementException'
occurred in system.management.dll
Additional information: Not found
here is the code:
string printerName = "";
foreach (ManagementObject printer in searcher.Get())
{
printerName = printer["Name"].ToString().ToLower();
if (printerName.Equals(@"\\web1\shipping1"))
{
//Console.WriteLine("Printer = " + printer["Name"]);
error occurs here>>> if
(printer["WorkOffline"].ToString().ToLower().Equals("true"))
{
//Class1.printerStatus = printer;
// printer is offline by user
// Console.WriteLine("Your Plug-N-Play printer is not
connected.");
}
else
{
// printer is not offline
// Console.WriteLine("Your Plug-N-Play printer is connected.");
}
}
}