语法
Visual Basic(声明)
Public Function GetPrintQueues As PrintQueueCollection
Visual Basic(用法)
Dim instance As PrintServer
Dim returnValue As PrintQueueCollection
returnValue = instance.GetPrintQueues()
C#
public PrintQueueCollection GetPrintQueues()
Visual C++
public:
PrintQueueCollection^ GetPrintQueues()
J#
public PrintQueueCollection GetPrintQueues()
JScript
public function GetPrintQueues() : PrintQueueCollection
返回值
类型:System.Printing..::.PrintQueueCollection
打印服务器上的打印队列的 PrintQueueCollection。
示例
下面的示例演示如何使用此方法列出 PrintServer 承载的打印队列。
C# 复制代码
// 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();