PrintSystemDesiredAccess Výčet

Definice

Určuje různá přístupová práva (nebo úrovně přístupu) pro tisk objektů.

public enum class PrintSystemDesiredAccess
public enum PrintSystemDesiredAccess
type PrintSystemDesiredAccess = 
Public Enum PrintSystemDesiredAccess
Dědičnost
PrintSystemDesiredAccess

Pole

AdministratePrinter 983052

Právo provádět všechny úlohy správy tiskové fronty, včetně práva pozastavit a obnovit jakoukoli tiskovou úlohu; a právo odstranit všechny úlohy z fronty. Tato úroveň přístupu zahrnuje také všechna práva v rámci UsePrinter.

AdministrateServer 983041

Právo provádět všechny úlohy správy tiskového serveru. Tato úroveň přístupu nezahrnujeAdministratePrinter práva pro tiskové fronty hostované serverem.

EnumerateServer 131074

Vpravo k výpisu front na tiskovém serveru.

None 0

Bez přístupu

UsePrinter 131080

Právo přidat tiskové úlohy do fronty a odstranit a vytvořit výčet vlastních úloh.

Příklady

Následující příklad ukazuje, jak pomocí tohoto výčtu nainstalovat druhou tiskárnu, která se liší svými vlastnostmi od stávající tiskárny pouze v umístění, portu a stavu sdíleného.

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

Poznámky

Přístupová práva, která jsou k dispozici na jednotlivých úrovních přístupu, se liší v závislosti na následujících:

  • Zda je tiskovým serverem počítač nebo zařízení tiskového serveru.

  • Operační systém, který se používá.

  • Nainstalované aktualizace zabezpečení.

  • Podporované zásady zabezpečení

Z tohoto důvodu jsou popisy přístupových práv v části "Členové" typické pro práva, která budou odpovídat jednotlivým úrovním přístupu, ale uvedené úrovně přístupu můžou poskytovat více nebo méně práv v konkrétních systémech.

Tyto hodnoty se primárně používají jako parametry pro PrintServer konstruktory a PrintQueue . Konstruktory vyvolá výjimky, pokud použijete hodnotu, která se může použít pouze na jiný druh objektu. Například nepředávejte AdministratePrinter konstruktoru PrintServer .

Platí pro