PrintServer 생성자

정의

PrintServer 클래스의 새 인스턴스를 초기화합니다.

오버로드

PrintServer()

PrintServer 클래스의 새 인스턴스를 초기화합니다.

PrintServer(PrintSystemDesiredAccess)

로컬 인쇄 서버를 나타내며 지정된 PrintServer를 로컬 인쇄 서버에 할당하는 PrintSystemDesiredAccess 클래스의 새 인스턴스를 초기화합니다.

PrintServer(String)

지정된 경로가 포함된 PrintServer 클래스의 새 인스턴스를 초기화합니다.

PrintServer(String, PrintServerIndexedProperty[])

초기화되는 속성을 확인하기 위해 지정된 PrintServer 배열을 사용하여 PrintServerIndexedProperty 클래스의 새 인스턴스를 초기화합니다.

PrintServer(String, PrintSystemDesiredAccess)

지정된 경로 및 필요한 액세스가 포함된 PrintServer 클래스의 새 인스턴스를 초기화합니다.

PrintServer(String, String[])

지정된 경로 및 속성 필터가 포함된 PrintServer 클래스의 새 인스턴스를 초기화합니다.

PrintServer(String, PrintServerIndexedProperty[], PrintSystemDesiredAccess)

PrintServer 클래스의 새 인스턴스를 초기화하고 지정된 경로, PrintServerIndexedProperty 배열 및 필요한 액세스를 제공합니다.

PrintServer(String, String[], PrintSystemDesiredAccess)

지정된 경로, 속성 필터 및 필요한 액세스가 포함된 PrintServer 클래스의 새 인스턴스를 초기화합니다.

PrintServer()

PrintServer 클래스의 새 인스턴스를 초기화합니다.

public:
 PrintServer();
public PrintServer ();
Public Sub New ()

적용 대상

PrintServer(PrintSystemDesiredAccess)

로컬 인쇄 서버를 나타내며 지정된 PrintServer를 로컬 인쇄 서버에 할당하는 PrintSystemDesiredAccess 클래스의 새 인스턴스를 초기화합니다.

public:
 PrintServer(System::Printing::PrintSystemDesiredAccess desiredAccess);
public PrintServer (System.Printing.PrintSystemDesiredAccess desiredAccess);
new System.Printing.PrintServer : System.Printing.PrintSystemDesiredAccess -> System.Printing.PrintServer
Public Sub New (desiredAccess As PrintSystemDesiredAccess)

매개 변수

desiredAccess
PrintSystemDesiredAccess

프로그램에 필요한 인쇄 서버 액세스 유형을 지정하는 값입니다.

예외

desiredAccessPrintQueue 개체가 아니라 LocalPrintServer 개체에만 적용될 수 있는 값인 경우(예: 예들 들어 UsePrinter입니다.

설명

합니다 PrintServer 와 같은 로컬 인쇄 서버의 속성을 사용 하 여 초기화 됩니다 Name합니다.

적용 대상

PrintServer(String)

지정된 경로가 포함된 PrintServer 클래스의 새 인스턴스를 초기화합니다.

public:
 PrintServer(System::String ^ path);
public PrintServer (string path);
new System.Printing.PrintServer : string -> System.Printing.PrintServer
Public Sub New (path As String)

매개 변수

path
String

인쇄 서버의 이름 및 전체 경로입니다.

예제

다음 예제에서는 인스턴스를 만들려면이 생성자를 사용 하는 방법을 보여 줍니다 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()

설명

하는 경우 path 됩니다 nullPrintServer 는 로컬 인쇄 서버를 나타냅니다와 같은 속성을 사용 하 여 초기화 됩니다 Name합니다.

적용 대상

PrintServer(String, PrintServerIndexedProperty[])

초기화되는 속성을 확인하기 위해 지정된 PrintServer 배열을 사용하여 PrintServerIndexedProperty 클래스의 새 인스턴스를 초기화합니다.

public:
 PrintServer(System::String ^ path, cli::array <System::Printing::PrintServerIndexedProperty> ^ propertiesFilter);
public PrintServer (string path, System.Printing.PrintServerIndexedProperty[] propertiesFilter);
new System.Printing.PrintServer : string * System.Printing.PrintServerIndexedProperty[] -> System.Printing.PrintServer
Public Sub New (path As String, propertiesFilter As PrintServerIndexedProperty())

매개 변수

path
String

인쇄 서버의 전체 경로 및 이름입니다.

propertiesFilter
PrintServerIndexedProperty[]

생성자가 초기화하는 속성입니다.

설명

하는 경우 path 됩니다 nullPrintServer 는 로컬 인쇄 서버를 나타냅니다와 같은 속성을 사용 하 여 초기화 됩니다 Name합니다.

적용 대상

PrintServer(String, PrintSystemDesiredAccess)

지정된 경로 및 필요한 액세스가 포함된 PrintServer 클래스의 새 인스턴스를 초기화합니다.

public:
 PrintServer(System::String ^ path, System::Printing::PrintSystemDesiredAccess desiredAccess);
public PrintServer (string path, System.Printing.PrintSystemDesiredAccess desiredAccess);
new System.Printing.PrintServer : string * System.Printing.PrintSystemDesiredAccess -> System.Printing.PrintServer
Public Sub New (path As String, desiredAccess As PrintSystemDesiredAccess)

매개 변수

path
String

인쇄 서버의 이름 및 전체 경로입니다.

desiredAccess
PrintSystemDesiredAccess

프로그램에 필요한 인쇄 서버 액세스 유형을 지정하는 값입니다.

예외

desiredAccessPrintQueue 개체가 아니라 LocalPrintServer 개체에만 적용될 수 있는 값인 경우(예: 예들 들어 UsePrinter입니다.

예제

다음 예제에서는 가능한 오류 상태에 대 한 모든 프린터를 조사 하려면이 생성자를 사용 하는 방법을 보여 줍니다.

// Survey queue status for every queue on every print server
System::String^ line;
System::String^ statusReport = "\n\nAny problem states are indicated below:\n\n";
while ((line = fileOfPrintServers->ReadLine()) != nullptr)
{
   System::Printing::PrintServer^ myPS = gcnew System::Printing::PrintServer(line, PrintSystemDesiredAccess::AdministrateServer);
   System::Printing::PrintQueueCollection^ myPrintQueues = myPS->GetPrintQueues();
   statusReport = statusReport + "\n" + line;
   for each (System::Printing::PrintQueue^ pq in myPrintQueues)
   {
      pq->Refresh();
      statusReport = statusReport + "\n\t" + pq->Name + ":";
      if (useAttributesResponse == "y")
      {
         TroubleSpotter::SpotTroubleUsingQueueAttributes(statusReport, pq);
         // TroubleSpotter class is defined in the complete example.
      } else
      {
         TroubleSpotter::SpotTroubleUsingProperties(statusReport, pq);
      }
   }
}
fileOfPrintServers->Close();
Console::WriteLine(statusReport);
Console::WriteLine("\nPress Return to continue.");
Console::ReadLine();
// Survey queue status for every queue on every print server
String line;
String statusReport = "\n\nAny problem states are indicated below:\n\n";
while ((line = fileOfPrintServers.ReadLine()) != null)
 {
     PrintServer myPS = new PrintServer(line, PrintSystemDesiredAccess.AdministrateServer);
     PrintQueueCollection myPrintQueues = myPS.GetPrintQueues();
     statusReport = statusReport + "\n" + line;
     foreach (PrintQueue pq in myPrintQueues)
     {
         pq.Refresh();
         statusReport = statusReport + "\n\t" + pq.Name + ":";
         if (useAttributesResponse == "y")
         {
             TroubleSpotter.SpotTroubleUsingQueueAttributes(ref statusReport, pq);
             // TroubleSpotter class is defined in the complete example.
         }
         else
         {
             TroubleSpotter.SpotTroubleUsingProperties(ref statusReport, pq);
         }                 
     }// end for each print queue
 }// end while list of print servers is not yet exhausted

fileOfPrintServers.Close();
Console.WriteLine(statusReport);
Console.WriteLine("\nPress Return to continue.");
Console.ReadLine();
' Survey queue status for every queue on every print server
Dim line As String
Dim statusReport As String = vbLf & vbLf & "Any problem states are indicated below:" & vbLf & vbLf
line = fileOfPrintServers.ReadLine()
Do While line IsNot Nothing
     Dim myPS As New PrintServer(line, PrintSystemDesiredAccess.AdministrateServer)
     Dim myPrintQueues As PrintQueueCollection = myPS.GetPrintQueues()
     statusReport = statusReport & vbLf & line
     For Each pq As PrintQueue In myPrintQueues
         pq.Refresh()
         statusReport = statusReport & vbLf & vbTab & pq.Name & ":"
         If useAttributesResponse = "y" Then
             TroubleSpotter.SpotTroubleUsingQueueAttributes(statusReport, pq)
             ' TroubleSpotter class is defined in the complete example.
         Else
             TroubleSpotter.SpotTroubleUsingProperties(statusReport, pq)
         End If

     Next pq ' end for each print queue

    line = fileOfPrintServers.ReadLine()
Loop ' end while list of print servers is not yet exhausted

fileOfPrintServers.Close()
Console.WriteLine(statusReport)
Console.WriteLine(vbLf & "Press Return to continue.")
Console.ReadLine()

설명

하는 경우 path 됩니다 nullPrintServer 는 로컬 인쇄 서버를 나타냅니다와 같은 속성을 사용 하 여 초기화 됩니다 Name합니다.

적용 대상

PrintServer(String, String[])

지정된 경로 및 속성 필터가 포함된 PrintServer 클래스의 새 인스턴스를 초기화합니다.

public:
 PrintServer(System::String ^ path, cli::array <System::String ^> ^ propertiesFilter);
public PrintServer (string path, string[] propertiesFilter);
new System.Printing.PrintServer : string * string[] -> System.Printing.PrintServer
Public Sub New (path As String, propertiesFilter As String())

매개 변수

path
String

인쇄 서버의 이름 및 전체 경로입니다.

propertiesFilter
String[]

생성자가 초기화하는 속성 이름의 배열입니다.

설명

하는 경우 path 됩니다 nullPrintServer 는 로컬 인쇄 서버를 나타냅니다와 같은 속성을 사용 하 여 초기화 됩니다 Name합니다.

적용 대상

PrintServer(String, PrintServerIndexedProperty[], PrintSystemDesiredAccess)

PrintServer 클래스의 새 인스턴스를 초기화하고 지정된 경로, PrintServerIndexedProperty 배열 및 필요한 액세스를 제공합니다.

public:
 PrintServer(System::String ^ path, cli::array <System::Printing::PrintServerIndexedProperty> ^ propertiesFilter, System::Printing::PrintSystemDesiredAccess desiredAccess);
public PrintServer (string path, System.Printing.PrintServerIndexedProperty[] propertiesFilter, System.Printing.PrintSystemDesiredAccess desiredAccess);
new System.Printing.PrintServer : string * System.Printing.PrintServerIndexedProperty[] * System.Printing.PrintSystemDesiredAccess -> System.Printing.PrintServer
Public Sub New (path As String, propertiesFilter As PrintServerIndexedProperty(), desiredAccess As PrintSystemDesiredAccess)

매개 변수

path
String

인쇄 서버의 전체 경로 및 이름입니다.

propertiesFilter
PrintServerIndexedProperty[]

생성자가 초기화하는 속성입니다.

desiredAccess
PrintSystemDesiredAccess

프로그램에 필요한 인쇄 서버 액세스 유형을 지정하는 값입니다.

예외

desiredAccessPrintQueue 개체가 아니라 LocalPrintServer 개체에만 적용될 수 있는 값인 경우(예: 예들 들어 UsePrinter입니다.

설명

하는 경우 path 됩니다 nullPrintServer 는 로컬 인쇄 서버를 나타냅니다와 같은 속성을 사용 하 여 초기화 됩니다 Name합니다.

적용 대상

PrintServer(String, String[], PrintSystemDesiredAccess)

지정된 경로, 속성 필터 및 필요한 액세스가 포함된 PrintServer 클래스의 새 인스턴스를 초기화합니다.

public:
 PrintServer(System::String ^ path, cli::array <System::String ^> ^ propertiesFilter, System::Printing::PrintSystemDesiredAccess desiredAccess);
public PrintServer (string path, string[] propertiesFilter, System.Printing.PrintSystemDesiredAccess desiredAccess);
new System.Printing.PrintServer : string * string[] * System.Printing.PrintSystemDesiredAccess -> System.Printing.PrintServer
Public Sub New (path As String, propertiesFilter As String(), desiredAccess As PrintSystemDesiredAccess)

매개 변수

path
String

인쇄 서버의 이름 및 전체 경로입니다.

propertiesFilter
String[]

생성자가 초기화하는 속성 이름의 배열입니다.

desiredAccess
PrintSystemDesiredAccess

프로그램에 필요한 인쇄 서버 액세스 유형을 지정하는 값입니다.

예외

desiredAccessPrintQueue 개체가 아니라 LocalPrintServer 개체에만 적용될 수 있는 값인 경우(예: 예들 들어 UsePrinter입니다.

설명

하는 경우 path 됩니다 nullPrintServer 는 로컬 인쇄 서버를 나타냅니다와 같은 속성을 사용 하 여 초기화 됩니다 Name합니다.

적용 대상