title: Printer status return wrong value
body: <p>I am trying to get the status of a network printer. I tried WMI code as this <a href="http://www.codeproject.com/Articles/6069/How-to-Check-if-your-Printer-is-Connected-using-C" rel="nofollow">link</a> says. But even if I removed the network cable, it always goes to the else part.</p>
  
  <p>Here is the code I tried :</p>
  
  <pre><code>ManagementObjectSearcher searcher = new 
               ManagementObjectSearcher("SELECT * FROM Win32_Printer");
  
  string printerName = "";
  
  foreach (ManagementObject printer in searcher.Get())
  {
      printerName = printer["Name"].ToString().ToLower();
  
      if (printer["WorkOffline"].ToString().ToLower().Equals("true") &amp;&amp; printer["Default"].ToString().ToLower().Equals("true"))
  
      {
         string s = "Printer  offline" + printerName;
         listBox1.Items.Add(s);
      }
      else
      {
          // printer is not offline
          //   Console.WriteLine("Your Plug-N-Play printer is connected.");
  
          string s = "Printer found and is online " + printerName;
          listBox1.Items.Add(s);
      }
  </code></pre>