Язык

PrintServer.InstallPrintQueue Метод

Определение

Устанавливает очередь печати и связанный с ним драйвер принтера на сервере печати.

Перегрузки

Имя Описание
InstallPrintQueue(String, String, String[], String, PrintPropertyDictionary)

Устанавливает очередь печати и связанный драйвер принтера на сервере печати.

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

Устанавливает очередь печати и связанный драйвер принтера на сервере печати.

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

Устанавливает приоритетную очередь печати и связанный драйвер принтера на сервере печати.

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

Устанавливает общую, приоритетную очередь печати и связанный драйвер принтера на сервере печати.

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

Устанавливает очередь печати и связанный драйвер принтера на сервере печати.

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

Параметры

printQueueName
String

Имя новой очереди.

driverName
String

Путь и имя драйвера принтера.

portNames
String[]

Идентификаторы портов, которые использует новая очередь.

printProcessorName
String

Имя обработчика печати.

initialParameters
PrintPropertyDictionary

Параметры, инициализированные.

Возвращаемое значение

Новый PrintQueue.

Примеры

В следующем примере показано, как использовать этот метод (вызываемый LocalPrintServer объект, наследующий метод от PrintServer) для установки второго принтера, который отличается от его свойств от существующего принтера только в расположении, порту и общем состоянии.

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

Применяется к

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

Устанавливает очередь печати и связанный драйвер принтера на сервере печати.

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

Параметры

printQueueName
String

Имя новой очереди.

driverName
String

Путь и имя драйвера принтера.

portNames
String[]

Идентификаторы портов, которые использует новая очередь.

printProcessorName
String

Имя обработчика печати.

printQueueAttributes
PrintQueueAttributes

Атрибуты, как флаги, новой очереди.

Возвращаемое значение

Только что созданный PrintQueue.

Применяется к

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

Устанавливает приоритетную очередь печати и связанный драйвер принтера на сервере печати.

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

Параметры

printQueueName
String

Имя новой очереди.

driverName
String

Путь и имя драйвера принтера.

portNames
String[]

Идентификаторы портов, которые использует новая очередь.

printProcessorName
String

Имя обработчика печати.

printQueueAttributes
PrintQueueAttributes

Атрибуты, как флаги, новой очереди.

printQueueProperty
PrintQueueStringProperty

Примечания, расположения или общего доступа к новой очереди.

printQueuePriority
Int32

Значение от 1 до 99, указывающее приоритет этой очереди печати относительно других очередей, размещенных сервером печати.

printQueueDefaultPriority
Int32

Значение от 1 до 99, указывающее приоритет заданий печати по умолчанию, отправляемых в очередь.

Возвращаемое значение

Только что созданный PrintQueue.

Комментарии

printQueueProperty Используйте параметр для инициализации одного и только одного из свойств ShareNameочереди Commentили Location его свойств. Если вы хотите инициализировать несколько, используйте InstallPrintQueue(String, String, String[], String, PrintQueueAttributes, String, String, String, String, Int32, Int32) перегрузку этого метода.

Применяется к

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

Устанавливает общую, приоритетную очередь печати и связанный драйвер принтера на сервере печати.

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

Параметры

printQueueName
String

Имя новой очереди.

driverName
String

Путь и имя драйвера принтера.

portNames
String[]

Идентификаторы портов, которые использует новая очередь.

printProcessorName
String

Имя обработчика печати.

printQueueAttributes
PrintQueueAttributes

Атрибуты, как флаги, новой очереди.

printQueueShareName
String

Имя общей папки новой очереди.

printQueueComment
String

Комментарий о очереди, видимой пользователями в пользовательском интерфейсе Microsoft Windows.

printQueueLocation
String

Расположение новой очереди.

printQueueSeparatorFile
String

Путь к файлу, вставленном в начале каждого задания печати.

printQueuePriority
Int32

Значение от 1 до 99, указывающее приоритет очереди относительно других очередей, размещенных сервером печати.

printQueueDefaultPriority
Int32

Значение от 1 до 99, указывающее приоритет по умолчанию новых заданий печати, отправляемых в очередь.

Возвращаемое значение

Только что созданный PrintQueue.

Комментарии

Если вы не хотите инициализировать все три из ShareNameочередей или CommentLocation свойств; можно передать пустую строку для одной или нескольких printQueueShareNameстрок, printQueueCommentа также printQueueLocation. Если вы хотите инициализировать только одно из этих свойств, используйте InstallPrintQueue(String, String, String[], String, PrintQueueAttributes, PrintQueueStringProperty, Int32, Int32) перегрузку этого метода.

Применяется к