http://topic.csdn.net/u/20090831/08/9a829009-e118-4e87-9395-b1b1c180ba3a.html
我在上面这个链接找到bmwsl 的回答,能满足我的要求。 
但是里面OpenPrinter(),GetPrinter(),ClosePrinter()函数,PRINTER_INFO_2类,, 都提示不存在。 没有引用。
  是否应该要引用什么dll?

解决方案 »

  1.   

    是需要引用system32还是system下面的winspool.drv...? 但是里面的方法名师OpenPrinterA()
      

  2.   

    // Create a PrintServer
    // "theServer" must be a print server to which the user has full print access.
    PrintServer myPrintServer = new PrintServer(@"\\theServer");// List the print server's queues
    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();
      

  3.   

    Manages the print queues on a print server, which is usually a computer, but can be a dedicated hardware print server appliance. 
    Namespace:  System.Printing
    Assembly:  System.Printing (in System.Printing.dll)
      

  4.   

    http://msdn.microsoft.com/en-us/library/ms742418.aspxhttp://msdn.microsoft.com/en-us/library/ms742418.aspx
      

  5.   

    这个例子。 返回的状态太少了。 我还是感觉http://topic.csdn.net/u/20090831/08/9a829009-e118-4e87-9395-b1b1c180ba3a.html这个回答的很不错。。 只是我很迷糊。 我应该怎么调用那些方法和类。
      

  6.   


     请问你说的API函数是什么意识? 
      

  7.   

    因为我无法找到对应的dll,,只有WinSpool.lib,WinSpool.drv,WinSpool.h这3个文件。 难道真的需要我先生成dll才能调用其中的方法吗?
      

  8.   

    System.Printer;
    System.Drawing.Printing;
      

  9.   

    不是。。我using了这2个类。 都不可以。。
      

  10.   

    判断打印机工作状态http://hi.baidu.com/adaeniac/blog/item/332c69b576ae55c936d3ca07.html