Bagikan melalui


PrintServer.InstallPrintQueue Metode

Definisi

Menginstal antrean cetak, dan pengandar pencetak terkait, pada server cetak.

Overload

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

Menginstal antrean cetak, dan pengandar pencetak terkait, pada server cetak.

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

Menginstal antrean cetak, dan pengandar pencetak terkait, pada server cetak.

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

Menginstal antrean cetak yang diprioritaskan, dan pengandar pencetak terkait, pada server cetak.

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

Menginstal antrean cetak bersama yang diprioritaskan, dan pengandar pencetak terkait, pada server cetak.

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

Menginstal antrean cetak, dan pengandar pencetak terkait, pada server cetak.

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

Parameter

printQueueName
String

Nama antrean baru.

driverName
String

Jalur dan nama pengandar pencetak.

portNames
String[]

ID port yang digunakan antrean baru.

printProcessorName
String

Nama prosesor cetak.

initialParameters
PrintPropertyDictionary

Parameter yang diinisialisasi.

Mengembalikan

Yang baru PrintQueue.

Contoh

Contoh berikut menunjukkan cara menggunakan metode ini (dipanggil pada LocalPrintServer objek yang mewarisi metode dari PrintServer) untuk menginstal printer kedua yang berbeda dalam propertinya dari printer yang ada hanya di lokasi, port, dan status bersama.

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

Berlaku untuk

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

Menginstal antrean cetak, dan pengandar pencetak terkait, pada server cetak.

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

Parameter

printQueueName
String

Nama antrean baru.

driverName
String

Jalur dan nama pengandar pencetak.

portNames
String[]

ID port yang digunakan antrean baru.

printProcessorName
String

Nama prosesor cetak.

printQueueAttributes
PrintQueueAttributes

Atribut, sebagai bendera, dari antrean baru.

Mengembalikan

Yang baru dibuat PrintQueue.

Berlaku untuk

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

Menginstal antrean cetak yang diprioritaskan, dan pengandar pencetak terkait, pada server cetak.

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

Parameter

printQueueName
String

Nama antrean baru.

driverName
String

Jalur dan nama pengandar pencetak.

portNames
String[]

ID port yang digunakan antrean baru.

printProcessorName
String

Nama prosesor cetak.

printQueueAttributes
PrintQueueAttributes

Atribut, sebagai bendera, dari antrean baru.

printQueueProperty
PrintQueueStringProperty

Komentar, lokasi, atau nama berbagi antrean baru.

printQueuePriority
Int32

Nilai dari 1 hingga 99 yang menentukan prioritas antrean cetak ini relatif terhadap antrean lain yang dihosting oleh server cetak.

printQueueDefaultPriority
Int32

Nilai dari 1 hingga 99 yang menentukan prioritas default pekerjaan cetak yang dikirim ke antrean.

Mengembalikan

Yang baru dibuat PrintQueue.

Keterangan

printQueueProperty Gunakan parameter untuk menginisialisasi satu, dan hanya satu, dari properti , , Commentatau Location antreanShareName. Jika Anda ingin menginisialisasi lebih dari satu, gunakan InstallPrintQueue(String, String, String[], String, PrintQueueAttributes, String, String, String, String, Int32, Int32) kelebihan beban metode ini.

Berlaku untuk

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

Menginstal antrean cetak bersama yang diprioritaskan, dan pengandar pencetak terkait, pada server cetak.

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

Parameter

printQueueName
String

Nama antrean baru.

driverName
String

Jalur dan nama pengandar pencetak.

portNames
String[]

ID port yang digunakan antrean baru.

printProcessorName
String

Nama prosesor cetak.

printQueueAttributes
PrintQueueAttributes

Atribut, sebagai bendera, dari antrean baru.

printQueueShareName
String

Nama berbagi antrean baru.

printQueueComment
String

Komentar tentang antrean yang terlihat oleh pengguna di UI Microsoft Windows.

printQueueLocation
String

Lokasi antrean baru.

printQueueSeparatorFile
String

Jalur file yang disisipkan di awal setiap tugas cetak.

printQueuePriority
Int32

Nilai dari 1 hingga 99 yang menentukan prioritas antrean relatif terhadap antrean lain yang dihosting oleh server cetak.

printQueueDefaultPriority
Int32

Nilai dari 1 hingga 99 yang menentukan prioritas default pekerjaan cetak baru yang dikirim ke antrean.

Mengembalikan

Yang baru dibuat PrintQueue.

Keterangan

Jika Anda tidak ingin menginisialisasi ketiga properti , , atau antreanShareName; Anda dapat meneruskan string kosong untuk satu atau beberapa printQueueShareName, , printQueueCommentdan printQueueLocation.LocationComment Jika Anda ingin menginisialisasi hanya salah satu properti ini, gunakan InstallPrintQueue(String, String, String[], String, PrintQueueAttributes, PrintQueueStringProperty, Int32, Int32) kelebihan beban metode ini.

Berlaku untuk