PrintServer.GetPrintQueues Metodo

Definizione

Ottiene l'insieme delle code di stampa ospitate dal server di stampa.Gets the collection of print queues that the print server hosts.

Overload

GetPrintQueues(String[], EnumeratedPrintQueueTypes[])

Ottiene l'insieme di code di stampa che appartengono all'oggetto EnumeratedPrintQueueTypes specificato e di cui vengono inizializzate solo le proprietà specificate.Gets the collection of print queues, which are of the specified EnumeratedPrintQueueTypes and are initialized only in the specified properties.

GetPrintQueues(PrintQueueIndexedProperty[], EnumeratedPrintQueueTypes[])

Ottiene un insieme di code di stampa dei tipi specificati.Gets a collection of print queues of the specified types. Nella matrice PrintQueueIndexedProperty vengono specificate le uniche proprietà inizializzate di tali code di stampa.These print queues are only initialized in the properties that are specified in the PrintQueueIndexedProperty array.

GetPrintQueues(String[])

Ottiene un insieme di code di stampa ospitate dal server di stampa e di cui vengono inizializzate unicamente le proprietà specificate.Gets a collection of print queues that are hosted by the print server and that are initialized only in the specified properties.

GetPrintQueues(EnumeratedPrintQueueTypes[])

Ottiene l'insieme delle code di stampa dei tipi specificati, indicate in EnumeratedPrintQueueTypes e ospitate dal server di stampa.Gets the collection of print queues of the specified types that are named in EnumeratedPrintQueueTypes and hosted by the print server.

GetPrintQueues()

Ottiene l'insieme delle code di stampa ospitate dal server di stampa.Gets the collection of print queues that the print server hosts.

GetPrintQueues(PrintQueueIndexedProperty[])

Ottiene un insieme di code di stampa ospitate dal server di stampa e di cui vengono inizializzate unicamente le proprietà specificate nella matrice PrintQueueIndexedProperty.Gets a collection of print queues that are hosted by the print server and initialized only in the properties that are specified in the PrintQueueIndexedProperty array.

GetPrintQueues(String[], EnumeratedPrintQueueTypes[])

Ottiene l'insieme di code di stampa che appartengono all'oggetto EnumeratedPrintQueueTypes specificato e di cui vengono inizializzate solo le proprietà specificate.Gets the collection of print queues, which are of the specified EnumeratedPrintQueueTypes and are initialized only in the specified properties.

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

Parametri

propertiesFilter
String[]

Nomi delle proprietà della coda inizializzate.The names of the queue properties that are initialized.

enumerationFlag
EnumeratedPrintQueueTypes[]

Matrice di valori che rappresentano i tipi di code di stampa restituiti nell'insieme.An array of values that represent the types of print queues that are returned in the collection.

Restituisce

PrintQueueCollection di code di stampa dei tipi specificati. Di ciascuna coda di stampa vengono inizializzate solo le proprietà specificate.A PrintQueueCollection of print queues of the specified types; each print queue has only the specified properties initialized.

GetPrintQueues(PrintQueueIndexedProperty[], EnumeratedPrintQueueTypes[])

Ottiene un insieme di code di stampa dei tipi specificati.Gets a collection of print queues of the specified types. Nella matrice PrintQueueIndexedProperty vengono specificate le uniche proprietà inizializzate di tali code di stampa.These print queues are only initialized in the properties that are specified in the PrintQueueIndexedProperty array.

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

Parametri

propertiesFilter
PrintQueueIndexedProperty[]

Proprietà inizializzate dal costruttore.The properties that the constructor initializes.

enumerationFlag
EnumeratedPrintQueueTypes[]

Matrice di valori che rappresentano i tipi di code di stampa presenti nell'insieme.An array of values that represent the types of print queues in the collection.

Restituisce

Oggetto PrintQueueCollection del server di stampa.The PrintQueueCollection of the print server.

Commenti

Le code della raccolta vengono inizializzate solo nelle proprietà elencate nella PrintQueueIndexedProperty matrice.The queues in the collection are only initialized in the properties that are listed in the PrintQueueIndexedProperty array.

GetPrintQueues(String[])

Ottiene un insieme di code di stampa ospitate dal server di stampa e di cui vengono inizializzate unicamente le proprietà specificate.Gets a collection of print queues that are hosted by the print server and that are initialized only in the specified properties.

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

Parametri

propertiesFilter
String[]

Nomi delle proprietà della coda inizializzate.The names of the queue properties that are initialized.

Restituisce

PrintQueueCollection di code di stampa sul server di stampa. Di ciascuna coda di stampa vengono inizializzate solo le proprietà specificate in propertiesFilter.The PrintQueueCollection of print queues on the print server; each print queue is initialized only in the properties that are specified in propertiesFilter.

GetPrintQueues(EnumeratedPrintQueueTypes[])

Ottiene l'insieme delle code di stampa dei tipi specificati, indicate in EnumeratedPrintQueueTypes e ospitate dal server di stampa.Gets the collection of print queues of the specified types that are named in EnumeratedPrintQueueTypes and hosted by the print server.

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

Parametri

enumerationFlag
EnumeratedPrintQueueTypes[]

Matrice di valori che rappresentano i tipi di code di stampa presenti nell'insieme.An array of values that represent the types of print queues that are in the collection.

Restituisce

PrintQueueCollection delle code di stampa dei tipi specificati presenti nel server di stampa.The PrintQueueCollection of print queues, of the specified types, on the print server.

Esempi

Nell'esempio seguente viene illustrato come utilizzare questo metodo per ottenere un sottoinsieme di code di stampa disponibili.The following example shows how to use this method to get a subset of available print queues.

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

Ottiene l'insieme delle code di stampa ospitate dal server di stampa.Gets the collection of print queues that the print server hosts.

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

Restituisce

PrintQueueCollection delle code di stampa sul server di stampa.The PrintQueueCollection of print queues on the print server.

Esempi

Nell'esempio seguente viene illustrato come utilizzare questo metodo per elencare le code di stampa ospitate PrintServerda un oggetto.The following example shows how to use this method to list the print queues hosted by a 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[])

Ottiene un insieme di code di stampa ospitate dal server di stampa e di cui vengono inizializzate unicamente le proprietà specificate nella matrice PrintQueueIndexedProperty.Gets a collection of print queues that are hosted by the print server and initialized only in the properties that are specified in the PrintQueueIndexedProperty array.

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

Parametri

propertiesFilter
PrintQueueIndexedProperty[]

Proprietà inizializzate dal costruttore.The properties that the constructor initializes.

Restituisce

In propertiesFilter vengono specificate le uniche proprietà inizializzate dei membri dell'oggetto PrintQueueCollection.A PrintQueueCollection whose members are initialized only in the properties specified by propertiesFilter.

Si applica a