PrintServer.GetPrintQueues Método

Definición

Obtiene la colección de colas de impresión que se hospedan en el servidor de impresión.

Sobrecargas

GetPrintQueues(String[], EnumeratedPrintQueueTypes[])

Obtiene la colección de colas de impresión, que son de los tipos EnumeratedPrintQueueTypes especificados y sólo se inicializan en las propiedades especificadas.

GetPrintQueues(PrintQueueIndexedProperty[], EnumeratedPrintQueueTypes[])

Obtiene una colección de colas de impresión de los tipos especificados. Estas colas de impresión sólo se inicializan en las propiedades que se especifican en la matriz PrintQueueIndexedProperty.

GetPrintQueues(String[])

Obtiene una colección de colas de impresión que se hospedan en el servidor de impresión y que sólo se inicializan en las propiedades especificadas.

GetPrintQueues(EnumeratedPrintQueueTypes[])

Obtiene la colección de colas de impresión de los tipos especificados nombrados en EnumeratedPrintQueueTypes y que se hospedan en el servidor de impresión.

GetPrintQueues()

Obtiene la colección de colas de impresión que se hospedan en el servidor de impresión.

GetPrintQueues(PrintQueueIndexedProperty[])

Obtiene una colección de colas de impresión que se hospedan en el servidor de impresión y que sólo se inicializan en las propiedades especificadas en la matriz PrintQueueIndexedProperty.

GetPrintQueues(String[], EnumeratedPrintQueueTypes[])

Obtiene la colección de colas de impresión, que son de los tipos EnumeratedPrintQueueTypes especificados y sólo se inicializan en las propiedades especificadas.

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

Parámetros

propertiesFilter
String[]

Los nombres de las propiedades de cola que se inicializan.

enumerationFlag
EnumeratedPrintQueueTypes[]

Matriz de valores que representan los tipos de colas de impresión que se devuelven en la colección.

Devoluciones

Una PrintQueueCollection de colas de impresión de los tipos especificados; cada cola de impresión tiene sólo las propiedades especificadas inicializadas.

Se aplica a

GetPrintQueues(PrintQueueIndexedProperty[], EnumeratedPrintQueueTypes[])

Obtiene una colección de colas de impresión de los tipos especificados. Estas colas de impresión sólo se inicializan en las propiedades que se especifican en la matriz 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

Parámetros

propertiesFilter
PrintQueueIndexedProperty[]

Propiedades que el constructor inicializa.

enumerationFlag
EnumeratedPrintQueueTypes[]

Matriz de valores que representan los tipos de colas de impresión de la colección.

Devoluciones

La PrintQueueCollection del servidor de impresión.

Comentarios

Las colas de la colección solo se inicializan en las propiedades que se enumeran en la PrintQueueIndexedProperty matriz.

Se aplica a

GetPrintQueues(String[])

Obtiene una colección de colas de impresión que se hospedan en el servidor de impresión y que sólo se inicializan en las propiedades especificadas.

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

Parámetros

propertiesFilter
String[]

Los nombres de las propiedades de cola que se inicializan.

Devoluciones

La PrintQueueCollection de colas de impresión en el servidor de impresión; cada cola de impresión sólo se inicializa en las propiedades que se especifican en propertiesFilter.

Se aplica a

GetPrintQueues(EnumeratedPrintQueueTypes[])

Obtiene la colección de colas de impresión de los tipos especificados nombrados en EnumeratedPrintQueueTypes y que se hospedan en el servidor de impresión.

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

Parámetros

enumerationFlag
EnumeratedPrintQueueTypes[]

Matriz de valores que representan los tipos de colas de impresión que están en la colección.

Devoluciones

La PrintQueueCollection de colas de impresión, de los tipos especificados, en el servidor de impresión.

Ejemplos

En el ejemplo siguiente se muestra cómo usar este método para obtener un subconjunto de colas de impresión disponibles.

// 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()

Se aplica a

GetPrintQueues()

Obtiene la colección de colas de impresión que se hospedan en el servidor de impresión.

public:
 System::Printing::PrintQueueCollection ^ GetPrintQueues();
public System.Printing.PrintQueueCollection GetPrintQueues ();
member this.GetPrintQueues : unit -> System.Printing.PrintQueueCollection
Public Function GetPrintQueues () As PrintQueueCollection

Devoluciones

La PrintQueueCollection de colas de impresión del servidor de impresión.

Ejemplos

En el ejemplo siguiente se muestra cómo usar este método para enumerar las colas de impresión hospedadas por un 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()

Se aplica a

GetPrintQueues(PrintQueueIndexedProperty[])

Obtiene una colección de colas de impresión que se hospedan en el servidor de impresión y que sólo se inicializan en las propiedades especificadas en la matriz 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

Parámetros

propertiesFilter
PrintQueueIndexedProperty[]

Propiedades que el constructor inicializa.

Devoluciones

Una PrintQueueCollection cuyos miembros sólo se inicializan en las propiedades que especifica propertiesFilter.

Se aplica a