title: How to connect C# with Remote printer
body: <p>I'm trying to connect connect C# and remote server using <code>System.printing</code> namespace
  This is my code it execute fine but it does not print anything and I don't know why.</p>
  
  <pre><code>[DllImport("winspool.drv")]
  public static extern bool AddPrinterConnection(string PrinterName);
  [DllImport("winspool.drv")]
  public static extern bool SetDefaultPrinter(string printerName);
  
  private void ConnectToNetworkPrinter()
  {
      bool result = AddPrinterConnection(@"\\CHSADMIN-PC\Canon LBP2900");
      bool resultdef = SetDefaultPrinter(@"\\CHSADMIN-PC\Canon LBP2900");
  }
  
  public void Button1_Click(object sender, EventArgs e)
  {
      PrintServer myPrintServer = new PrintServer(
          @"\\CHSADMIN-PC", 
          System.Printing.PrintSystemDesiredAccess.EnumerateServer);
      PrintQueueCollection myPrintQueues = myPrintServer.GetPrintQueues();
  
      String printQueueNames = "My Print Queues:\n\n";
      foreach (PrintQueue pq in myPrintQueues)
      {
          printQueueNames += "\t" + pq.Name + "\n";
      }
  
      Console.WriteLine(printQueueNames);
      Console.WriteLine("\nPress Return to continue.");
      Console.ReadLine();
  }
  </code></pre>