PrintServer.GetPrintQueues Метод
Определение
Важно!
Некоторые сведения относятся к предварительной версии продукта, в которую до выпуска могут быть внесены существенные изменения. Майкрософт не предоставляет никаких гарантий, явных или подразумеваемых, относительно приведенных здесь сведений.
Возвращает коллекцию очередей печати, которые размещаются на сервере печати.
Перегрузки
| GetPrintQueues(String[], EnumeratedPrintQueueTypes[]) |
Возвращает коллекцию очередей печати определенного типа EnumeratedPrintQueueTypes, у которых инициализируются только указанные свойства. |
| GetPrintQueues(PrintQueueIndexedProperty[], EnumeratedPrintQueueTypes[]) |
Возвращает коллекцию очередей печати заданных типов. У этих очередей печати инициализируются только те свойства, которые указаны в массиве PrintQueueIndexedProperty. |
| GetPrintQueues(String[]) |
Возвращает коллекцию очередей печати, которые размещаются на сервере печати и у которых инициализированы только указанные свойства. |
| GetPrintQueues(EnumeratedPrintQueueTypes[]) |
Возвращает коллекцию размещенных на сервере печати очередей печати заданных типов, названия которых содержатся в коллекции EnumeratedPrintQueueTypes. |
| GetPrintQueues() |
Возвращает коллекцию очередей печати, которые размещаются на сервере печати. |
| GetPrintQueues(PrintQueueIndexedProperty[]) |
Возвращает коллекцию очередей печати, которые размещаются на сервере печати и у которых инициализированы только свойства, указанные в массиве PrintQueueIndexedProperty. |
GetPrintQueues(String[], EnumeratedPrintQueueTypes[])
Возвращает коллекцию очередей печати определенного типа EnumeratedPrintQueueTypes, у которых инициализируются только указанные свойства.
public:
System::Printing::PrintQueueCollection ^ GetPrintQueues(cli::array <System::String ^> ^ propertiesFilter, cli::array <System::Printing::EnumeratedPrintQueueTypes> ^ enumerationFlag);
public System.Printing.PrintQueueCollection GetPrintQueues (string[] propertiesFilter, System.Printing.EnumeratedPrintQueueTypes[] enumerationFlag);
member this.GetPrintQueues : string[] * System.Printing.EnumeratedPrintQueueTypes[] -> System.Printing.PrintQueueCollection
Public Function GetPrintQueues (propertiesFilter As String(), enumerationFlag As EnumeratedPrintQueueTypes()) As PrintQueueCollection
Параметры
- propertiesFilter
- String[]
Имена инициализированных свойств очереди.
- enumerationFlag
- EnumeratedPrintQueueTypes[]
Массив значений, представляющих типы очередей печати, возвращаемых коллекцией.
Возвращаемое значение
Коллекция PrintQueueCollection очередей печати заданных типов. У каждой очереди инициализированы только указанные свойства.
Применяется к
GetPrintQueues(PrintQueueIndexedProperty[], EnumeratedPrintQueueTypes[])
Возвращает коллекцию очередей печати заданных типов. У этих очередей печати инициализируются только те свойства, которые указаны в массиве PrintQueueIndexedProperty.
public:
System::Printing::PrintQueueCollection ^ GetPrintQueues(cli::array <System::Printing::PrintQueueIndexedProperty> ^ propertiesFilter, cli::array <System::Printing::EnumeratedPrintQueueTypes> ^ enumerationFlag);
public System.Printing.PrintQueueCollection GetPrintQueues (System.Printing.PrintQueueIndexedProperty[] propertiesFilter, System.Printing.EnumeratedPrintQueueTypes[] enumerationFlag);
member this.GetPrintQueues : System.Printing.PrintQueueIndexedProperty[] * System.Printing.EnumeratedPrintQueueTypes[] -> System.Printing.PrintQueueCollection
Public Function GetPrintQueues (propertiesFilter As PrintQueueIndexedProperty(), enumerationFlag As EnumeratedPrintQueueTypes()) As PrintQueueCollection
Параметры
- propertiesFilter
- PrintQueueIndexedProperty[]
Свойства, инициализируемые конструктором.
- enumerationFlag
- EnumeratedPrintQueueTypes[]
Массив значений, представляющих типы очередей печати, включенных в коллекцию.
Возвращаемое значение
Коллекция PrintQueueCollection сервера печати.
Комментарии
В коллекции очереди инициализируются только те свойства, которые перечислены в PrintQueueIndexedProperty массива.
Применяется к
GetPrintQueues(String[])
Возвращает коллекцию очередей печати, которые размещаются на сервере печати и у которых инициализированы только указанные свойства.
public:
System::Printing::PrintQueueCollection ^ GetPrintQueues(cli::array <System::String ^> ^ propertiesFilter);
public System.Printing.PrintQueueCollection GetPrintQueues (string[] propertiesFilter);
member this.GetPrintQueues : string[] -> System.Printing.PrintQueueCollection
Public Function GetPrintQueues (propertiesFilter As String()) As PrintQueueCollection
Параметры
- propertiesFilter
- String[]
Имена инициализированных свойств очереди.
Возвращаемое значение
Коллекция PrintQueueCollection очередей печати на сервере. У каждой очереди инициализируются только те свойства, которые указаны в параметре propertiesFilter.
Применяется к
GetPrintQueues(EnumeratedPrintQueueTypes[])
Возвращает коллекцию размещенных на сервере печати очередей печати заданных типов, названия которых содержатся в коллекции EnumeratedPrintQueueTypes.
public:
System::Printing::PrintQueueCollection ^ GetPrintQueues(cli::array <System::Printing::EnumeratedPrintQueueTypes> ^ enumerationFlag);
public System.Printing.PrintQueueCollection GetPrintQueues (System.Printing.EnumeratedPrintQueueTypes[] enumerationFlag);
member this.GetPrintQueues : System.Printing.EnumeratedPrintQueueTypes[] -> System.Printing.PrintQueueCollection
Public Function GetPrintQueues (enumerationFlag As EnumeratedPrintQueueTypes()) As PrintQueueCollection
Параметры
- enumerationFlag
- EnumeratedPrintQueueTypes[]
Массив значений, представляющих типы очередей печати, включенных в коллекцию.
Возвращаемое значение
Коллекция PrintQueueCollection размещенных на сервере печати очередей печати заданных типов.
Примеры
В следующем примере показано, как использовать этот метод для получения подмножества доступных очередей печати.
// Specify that the list will contain only the print queues that are installed as local and are shared
array<System::Printing::EnumeratedPrintQueueTypes>^ enumerationFlags = {EnumeratedPrintQueueTypes::Local,EnumeratedPrintQueueTypes::Shared};
LocalPrintServer^ printServer = gcnew LocalPrintServer();
//Use the enumerationFlags to filter out unwanted print queues
PrintQueueCollection^ printQueuesOnLocalServer = printServer->GetPrintQueues(enumerationFlags);
Console::WriteLine("These are your shared, local print queues:\n\n");
for each (PrintQueue^ printer in printQueuesOnLocalServer)
{
Console::WriteLine("\tThe shared printer " + printer->Name + " is located at " + printer->Location + "\n");
}
Console::WriteLine("Press enter to continue.");
Console::ReadLine();
// Specify that the list will contain only the print queues that are installed as local and are shared
EnumeratedPrintQueueTypes[] enumerationFlags = {EnumeratedPrintQueueTypes.Local,
EnumeratedPrintQueueTypes.Shared};
LocalPrintServer printServer = new LocalPrintServer();
//Use the enumerationFlags to filter out unwanted print queues
PrintQueueCollection printQueuesOnLocalServer = printServer.GetPrintQueues(enumerationFlags);
Console.WriteLine("These are your shared, local print queues:\n\n");
foreach (PrintQueue printer in printQueuesOnLocalServer)
{
Console.WriteLine("\tThe shared printer " + printer.Name + " is located at " + printer.Location + "\n");
}
Console.WriteLine("Press enter to continue.");
Console.ReadLine();
' Specify that the list will contain only the print queues that are installed as local and are shared
Dim enumerationFlags() As EnumeratedPrintQueueTypes = {EnumeratedPrintQueueTypes.Local, EnumeratedPrintQueueTypes.Shared}
Dim printServer As New LocalPrintServer()
'Use the enumerationFlags to filter out unwanted print queues
Dim printQueuesOnLocalServer As PrintQueueCollection = printServer.GetPrintQueues(enumerationFlags)
Console.WriteLine("These are your shared, local print queues:" & vbLf & vbLf)
For Each printer As PrintQueue In printQueuesOnLocalServer
Console.WriteLine(vbTab & "The shared printer " & printer.Name & " is located at " & printer.Location & vbLf)
Next printer
Console.WriteLine("Press enter to continue.")
Console.ReadLine()
Применяется к
GetPrintQueues()
Возвращает коллекцию очередей печати, которые размещаются на сервере печати.
public:
System::Printing::PrintQueueCollection ^ GetPrintQueues();
public System.Printing.PrintQueueCollection GetPrintQueues ();
member this.GetPrintQueues : unit -> System.Printing.PrintQueueCollection
Public Function GetPrintQueues () As PrintQueueCollection
Возвращаемое значение
Коллекция PrintQueueCollection очередей на сервере печати.
Примеры
В следующем примере показано, как использовать этот метод для вывода списка очередей печати, размещенных в PrintServer.
// 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();
' Create a PrintServer
' "theServer" must be a print server to which the user has full print access.
Dim myPrintServer As New PrintServer("\\theServer")
' List the print server's queues
Dim myPrintQueues As PrintQueueCollection = myPrintServer.GetPrintQueues()
Dim printQueueNames As String = "My Print Queues:" & vbLf & vbLf
For Each pq As PrintQueue In myPrintQueues
printQueueNames &= vbTab & pq.Name & vbLf
Next pq
Console.WriteLine(printQueueNames)
Console.WriteLine(vbLf & "Press Return to continue.")
Console.ReadLine()
Применяется к
GetPrintQueues(PrintQueueIndexedProperty[])
Возвращает коллекцию очередей печати, которые размещаются на сервере печати и у которых инициализированы только свойства, указанные в массиве PrintQueueIndexedProperty.
public:
System::Printing::PrintQueueCollection ^ GetPrintQueues(cli::array <System::Printing::PrintQueueIndexedProperty> ^ propertiesFilter);
public System.Printing.PrintQueueCollection GetPrintQueues (System.Printing.PrintQueueIndexedProperty[] propertiesFilter);
member this.GetPrintQueues : System.Printing.PrintQueueIndexedProperty[] -> System.Printing.PrintQueueCollection
Public Function GetPrintQueues (propertiesFilter As PrintQueueIndexedProperty()) As PrintQueueCollection
Параметры
- propertiesFilter
- PrintQueueIndexedProperty[]
Свойства, инициализируемые конструктором.
Возвращаемое значение
Коллекция PrintQueueCollection, элементы которой инициализируются только у свойств, указанных в параметре propertiesFilter.