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[]

新しいキューが使用するポートの ID。

printProcessorName
String

印刷プロセッサの名前。

initialParameters
PrintPropertyDictionary

初期化されるパラメーター。

返品

新しい PrintQueue

次の例では、このメソッド (PrintServer からメソッドを継承するLocalPrintServer オブジェクトで呼び出されます) を使用して、場所、ポート、および共有状態でのみ既存のプリンターとは異なる 2 つ目のプリンターをインストールする方法を示します。

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[]

新しいキューが使用するポートの ID。

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[]

新しいキューが使用するポートの ID。

printProcessorName
String

印刷プロセッサの名前。

printQueueAttributes
PrintQueueAttributes

新しいキューのフラグとしての属性。

printQueueProperty
PrintQueueStringProperty

新しいキューのコメント、場所、または共有名。

printQueuePriority
Int32

プリント サーバーによってホストされている他のキューに対するこの印刷キューの優先順位を指定する 1 から 99 までの値。

printQueueDefaultPriority
Int32

キューに送信される印刷ジョブの既定の優先順位を指定する 1 から 99 までの値。

返品

新しく作成された PrintQueue

注釈

printQueueProperty パラメーターを使用して、キューのShareNameComment、またはLocationプロパティのうち 1 つだけを初期化します。 複数のメソッドを初期化する場合は、このメソッドの 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[]

新しいキューが使用するポートの ID。

printProcessorName
String

印刷プロセッサの名前。

printQueueAttributes
PrintQueueAttributes

新しいキューのフラグとしての属性。

printQueueShareName
String

新しいキューの共有名。

printQueueComment
String

Microsoft Windows UI でユーザーに表示されるキューに関するコメント。

printQueueLocation
String

新しいキューの場所。

printQueueSeparatorFile
String

各印刷ジョブの先頭に挿入されるファイルのパス。

printQueuePriority
Int32

プリント サーバーによってホストされている他のキューに対するキューの優先度を指定する 1 から 99 までの値。

printQueueDefaultPriority
Int32

キューに送信される新しい印刷ジョブのデフォルト優先順位を指定する 1 から 99 までの値。

返品

新しく作成された PrintQueue

注釈

キューの 3 つの ShareNameComment、または Location プロパティをすべて初期化しない場合は、1 つ以上の printQueueShareNameprintQueueCommentprintQueueLocationに空の文字列を渡すことができます。 これらのプロパティのいずれかを初期化する場合は、このメソッドの InstallPrintQueue(String, String, String[], String, PrintQueueAttributes, PrintQueueStringProperty, Int32, Int32) オーバーロードを使用します。

適用対象