PrintSystemDesiredAccess 열거형

정의

인쇄 개체에 대한 다양한 액세스 권한(또는 액세스 수준)을 지정합니다.

public enum class PrintSystemDesiredAccess
public enum PrintSystemDesiredAccess
type PrintSystemDesiredAccess = 
Public Enum PrintSystemDesiredAccess
상속
PrintSystemDesiredAccess

필드

Name Description
None 0

액세스 없음.

EnumerateServer 131074

인쇄 서버의 큐를 나열할 수 있는 권한입니다.

UsePrinter 131080

큐에 인쇄 작업을 추가하고 자신의 작업을 삭제하고 열거할 수 있는 권한입니다.

AdministrateServer 983041

인쇄 서버에 대한 모든 관리 작업을 수행할 수 있는 권한입니다. 이 액세스 수준에는 서버에서 호스트하는 인쇄 큐에 대한 권한이 포함되지AdministratePrinter 않습니다.

AdministratePrinter 983052

인쇄 작업을 일시 중지하고 다시 시작할 수 있는 권한을 포함하여 인쇄 큐에 대한 모든 관리 작업을 수행할 수 있는 권한입니다. 큐에서 모든 작업을 삭제할 수 있는 권한입니다. 이 액세스 수준에는 아래의 모든 권한도 포함됩니다 UsePrinter.

예제

다음 예제에서는 이 열거형을 사용하여 위치, 포트 및 공유 상태에만 있는 기존 프린터와 속성이 다른 두 번째 프린터를 설치하는 방법을 보여 줍니다.

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

설명

액세스의 각 수준에서 사용할 수 있는 액세스 권한은 다음에 따라 다릅니다.

  • 인쇄 서버가 컴퓨터인지 인쇄 서버 어플라이언스인지 여부입니다.

  • 사용되는 운영 체제입니다.

  • 설치된 보안 업데이트입니다.

  • 지원되는 보안 정책입니다.

이러한 이유로 "멤버" 섹션의 액세스 권한 설명은 각 액세스 수준에 해당하는 권한의 일반적이지만 나열된 액세스 수준은 특정 시스템에 대한 더 많거나 적은 권한을 제공할 수 있습니다.

이러한 값은 주로 생성자에 대한 PrintServerPrintQueue 매개 변수로 사용됩니다. 다른 종류의 개체에만 적용할 수 있는 값을 사용하는 경우 생성자는 예외를 throw합니다. 예를 들어 AdministratePrinter를 PrintServer 생성자에 전달하지 마세요.

적용 대상