PrintServer.InstallPrintQueue Metoda

Definicja

Instaluje kolejkę wydruku i skojarzony z nią sterownik drukarki na serwerze wydruku.

Przeciążenia

InstallPrintQueue(String, String, String[], String, PrintPropertyDictionary)

Instaluje kolejkę wydruku i skojarzony sterownik drukarki na serwerze wydruku.

InstallPrintQueue(String, String, String[], String, PrintQueueAttributes)

Instaluje kolejkę wydruku i skojarzony sterownik drukarki na serwerze wydruku.

InstallPrintQueue(String, String, String[], String, PrintQueueAttributes, PrintQueueStringProperty, Int32, Int32)

Instaluje priorytetową kolejkę wydruku i skojarzony sterownik drukarki na serwerze wydruku.

InstallPrintQueue(String, String, String[], String, PrintQueueAttributes, String, String, String, String, Int32, Int32)

Instaluje udostępnioną, priorytetową kolejkę wydruku i skojarzony sterownik drukarki na serwerze wydruku.

InstallPrintQueue(String, String, String[], String, PrintPropertyDictionary)

Instaluje kolejkę wydruku i skojarzony sterownik drukarki na serwerze wydruku.

public:
 System::Printing::PrintQueue ^ InstallPrintQueue(System::String ^ printQueueName, System::String ^ driverName, cli::array <System::String ^> ^ portNames, System::String ^ printProcessorName, System::Printing::IndexedProperties::PrintPropertyDictionary ^ initialParameters);
public System.Printing.PrintQueue InstallPrintQueue (string printQueueName, string driverName, string[] portNames, string printProcessorName, System.Printing.IndexedProperties.PrintPropertyDictionary initialParameters);
member this.InstallPrintQueue : string * string * string[] * string * System.Printing.IndexedProperties.PrintPropertyDictionary -> System.Printing.PrintQueue
Public Function InstallPrintQueue (printQueueName As String, driverName As String, portNames As String(), printProcessorName As String, initialParameters As PrintPropertyDictionary) As PrintQueue

Parametry

printQueueName
String

Nazwa nowej kolejki.

driverName
String

Ścieżka i nazwa sterownika drukarki.

portNames
String[]

Identyfikatory portów używanych przez nową kolejkę.

printProcessorName
String

Nazwa procesora wydruku.

initialParameters
PrintPropertyDictionary

Parametry, które są inicjowane.

Zwraca

Nowy PrintQueueelement .

Przykłady

W poniższym przykładzie pokazano, jak użyć tej metody (wywoływanej na LocalPrintServer obiekcie, który dziedziczy metodę z PrintServer) w celu zainstalowania drugiej drukarki, która różni się jego właściwościami od istniejącej drukarki tylko w lokalizacji, porcie i stanie udostępnionym.

LocalPrintServer myLocalPrintServer = new LocalPrintServer(PrintSystemDesiredAccess.AdministrateServer);
PrintQueue sourcePrintQueue = myLocalPrintServer.DefaultPrintQueue;
PrintPropertyDictionary myPrintProperties = sourcePrintQueue.PropertiesCollection;

// Share the new printer using Remove/Add methods
PrintBooleanProperty shared = new PrintBooleanProperty("IsShared", true);
myPrintProperties.Remove("IsShared");
myPrintProperties.Add("IsShared", shared);

// Give the new printer its share name using SetProperty method
PrintStringProperty theShareName = new PrintStringProperty("ShareName", "\"Son of " + sourcePrintQueue.Name +"\"");
myPrintProperties.SetProperty("ShareName", theShareName);

// Specify the physical location of the new printer using Remove/Add methods
PrintStringProperty theLocation = new PrintStringProperty("Location", "the supply room");
myPrintProperties.Remove("Location");
myPrintProperties.Add("Location", theLocation);

// Specify the port for the new printer
String[] port = new String[] { "COM1:" };

// Install the new printer on the local print server
PrintQueue clonedPrinter = myLocalPrintServer.InstallPrintQueue("My clone of " + sourcePrintQueue.Name, "Xerox WCP 35 PS", port, "WinPrint", myPrintProperties);
myLocalPrintServer.Commit();

// Report outcome
Console.WriteLine("{0} in {1} has been installed and shared as {2}", clonedPrinter.Name, clonedPrinter.Location, clonedPrinter.ShareName);
Console.WriteLine("Press Return to continue ...");
Console.ReadLine();
Dim myLocalPrintServer As New LocalPrintServer(PrintSystemDesiredAccess.AdministrateServer)
Dim sourcePrintQueue As PrintQueue = myLocalPrintServer.DefaultPrintQueue
Dim myPrintProperties As PrintPropertyDictionary = sourcePrintQueue.PropertiesCollection

' Share the new printer using Remove/Add methods
Dim [shared] As New PrintBooleanProperty("IsShared", True)
myPrintProperties.Remove("IsShared")
myPrintProperties.Add("IsShared", [shared])

' Give the new printer its share name using SetProperty method
Dim theShareName As New PrintStringProperty("ShareName", """Son of " & sourcePrintQueue.Name & """")
myPrintProperties.SetProperty("ShareName", theShareName)

' Specify the physical location of the new printer using Remove/Add methods
Dim theLocation As New PrintStringProperty("Location", "the supply room")
myPrintProperties.Remove("Location")
myPrintProperties.Add("Location", theLocation)

' Specify the port for the new printer
Dim port() As String = { "COM1:" }


' Install the new printer on the local print server
Dim clonedPrinter As PrintQueue = myLocalPrintServer.InstallPrintQueue("My clone of " & sourcePrintQueue.Name, "Xerox WCP 35 PS", port, "WinPrint", myPrintProperties)
myLocalPrintServer.Commit()

' Report outcome
Console.WriteLine("{0} in {1} has been installed and shared as {2}", clonedPrinter.Name, clonedPrinter.Location, clonedPrinter.ShareName)
Console.WriteLine("Press Return to continue ...")
Console.ReadLine()

Dotyczy

InstallPrintQueue(String, String, String[], String, PrintQueueAttributes)

Instaluje kolejkę wydruku i skojarzony sterownik drukarki na serwerze wydruku.

public:
 System::Printing::PrintQueue ^ InstallPrintQueue(System::String ^ printQueueName, System::String ^ driverName, cli::array <System::String ^> ^ portNames, System::String ^ printProcessorName, System::Printing::PrintQueueAttributes printQueueAttributes);
public System.Printing.PrintQueue InstallPrintQueue (string printQueueName, string driverName, string[] portNames, string printProcessorName, System.Printing.PrintQueueAttributes printQueueAttributes);
member this.InstallPrintQueue : string * string * string[] * string * System.Printing.PrintQueueAttributes -> System.Printing.PrintQueue
Public Function InstallPrintQueue (printQueueName As String, driverName As String, portNames As String(), printProcessorName As String, printQueueAttributes As PrintQueueAttributes) As PrintQueue

Parametry

printQueueName
String

Nazwa nowej kolejki.

driverName
String

Ścieżka i nazwa sterownika drukarki.

portNames
String[]

Identyfikatory portów używanych przez nową kolejkę.

printProcessorName
String

Nazwa procesora wydruku.

printQueueAttributes
PrintQueueAttributes

Atrybuty, jako flagi, nowej kolejki.

Zwraca

Nowo utworzony element PrintQueue.

Dotyczy

InstallPrintQueue(String, String, String[], String, PrintQueueAttributes, PrintQueueStringProperty, Int32, Int32)

Instaluje priorytetową kolejkę wydruku i skojarzony sterownik drukarki na serwerze wydruku.

public:
 System::Printing::PrintQueue ^ InstallPrintQueue(System::String ^ printQueueName, System::String ^ driverName, cli::array <System::String ^> ^ portNames, System::String ^ printProcessorName, System::Printing::PrintQueueAttributes printQueueAttributes, System::Printing::PrintQueueStringProperty ^ printQueueProperty, int printQueuePriority, int printQueueDefaultPriority);
public System.Printing.PrintQueue InstallPrintQueue (string printQueueName, string driverName, string[] portNames, string printProcessorName, System.Printing.PrintQueueAttributes printQueueAttributes, System.Printing.PrintQueueStringProperty printQueueProperty, int printQueuePriority, int printQueueDefaultPriority);
member this.InstallPrintQueue : string * string * string[] * string * System.Printing.PrintQueueAttributes * System.Printing.PrintQueueStringProperty * int * int -> System.Printing.PrintQueue
Public Function InstallPrintQueue (printQueueName As String, driverName As String, portNames As String(), printProcessorName As String, printQueueAttributes As PrintQueueAttributes, printQueueProperty As PrintQueueStringProperty, printQueuePriority As Integer, printQueueDefaultPriority As Integer) As PrintQueue

Parametry

printQueueName
String

Nazwa nowej kolejki.

driverName
String

Ścieżka i nazwa sterownika drukarki.

portNames
String[]

Identyfikatory portów używanych przez nową kolejkę.

printProcessorName
String

Nazwa procesora wydruku.

printQueueAttributes
PrintQueueAttributes

Atrybuty, jako flagi, nowej kolejki.

printQueueProperty
PrintQueueStringProperty

Komentarz, lokalizacja lub nazwa udziału nowej kolejki.

printQueuePriority
Int32

Wartość z zakresu od 1 do 99, która określa priorytet tej kolejki wydruku względem innych kolejek hostowanych przez serwer wydruku.

printQueueDefaultPriority
Int32

Wartość z zakresu od 1 do 99, która określa domyślny priorytet zadań drukowania wysyłanych do kolejki.

Zwraca

Nowo utworzony element PrintQueue.

Uwagi

Użyj parametru printQueueProperty , aby zainicjować jeden i tylko jeden z właściwości , lub Location kolejkiShareNameComment. Jeśli chcesz zainicjować więcej niż jedną metodę, użyj InstallPrintQueue(String, String, String[], String, PrintQueueAttributes, String, String, String, String, Int32, Int32) przeciążenia tej metody.

Dotyczy

InstallPrintQueue(String, String, String[], String, PrintQueueAttributes, String, String, String, String, Int32, Int32)

Instaluje udostępnioną, priorytetową kolejkę wydruku i skojarzony sterownik drukarki na serwerze wydruku.

public:
 System::Printing::PrintQueue ^ InstallPrintQueue(System::String ^ printQueueName, System::String ^ driverName, cli::array <System::String ^> ^ portNames, System::String ^ printProcessorName, System::Printing::PrintQueueAttributes printQueueAttributes, System::String ^ printQueueShareName, System::String ^ printQueueComment, System::String ^ printQueueLocation, System::String ^ printQueueSeparatorFile, int printQueuePriority, int printQueueDefaultPriority);
public System.Printing.PrintQueue InstallPrintQueue (string printQueueName, string driverName, string[] portNames, string printProcessorName, System.Printing.PrintQueueAttributes printQueueAttributes, string printQueueShareName, string printQueueComment, string printQueueLocation, string printQueueSeparatorFile, int printQueuePriority, int printQueueDefaultPriority);
member this.InstallPrintQueue : string * string * string[] * string * System.Printing.PrintQueueAttributes * string * string * string * string * int * int -> System.Printing.PrintQueue
Public Function InstallPrintQueue (printQueueName As String, driverName As String, portNames As String(), printProcessorName As String, printQueueAttributes As PrintQueueAttributes, printQueueShareName As String, printQueueComment As String, printQueueLocation As String, printQueueSeparatorFile As String, printQueuePriority As Integer, printQueueDefaultPriority As Integer) As PrintQueue

Parametry

printQueueName
String

Nazwa nowej kolejki.

driverName
String

Ścieżka i nazwa sterownika drukarki.

portNames
String[]

Identyfikatory portów używanych przez nową kolejkę.

printProcessorName
String

Nazwa procesora wydruku.

printQueueAttributes
PrintQueueAttributes

Atrybuty, jako flagi, nowej kolejki.

printQueueShareName
String

Nazwa udziału nowej kolejki.

printQueueComment
String

Komentarz dotyczący kolejki widocznej dla użytkowników w interfejsie użytkownika systemu Microsoft Windows.

printQueueLocation
String

Lokalizacja nowej kolejki.

printQueueSeparatorFile
String

Ścieżka pliku wstawionego na początku każdego zadania drukowania.

printQueuePriority
Int32

Wartość z zakresu od 1 do 99, która określa priorytet kolejki względem innych kolejek hostowanych przez serwer wydruku.

printQueueDefaultPriority
Int32

Wartość z zakresu od 1 do 99, która określa domyślny priorytet nowych zadań drukowania wysyłanych do kolejki.

Zwraca

Nowo utworzony element PrintQueue.

Uwagi

Jeśli nie chcesz zainicjować wszystkich trzech właściwości , lub kolejkiShareName, możesz przekazać pusty ciąg dla co najmniej jednej z printQueueShareNamewartości , printQueueCommenti printQueueLocation.LocationComment Jeśli chcesz zainicjować tylko jedną z tych właściwości, użyj InstallPrintQueue(String, String, String[], String, PrintQueueAttributes, PrintQueueStringProperty, Int32, Int32) przeciążenia tej metody.

Dotyczy