PrintSystemDesiredAccess Výčet
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
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
Pole
| Name | Hodnota | Description |
|---|---|---|
| None | 0 | Bez přístupu. |
| EnumerateServer | 131074 | Právo vypsat fronty na tiskovém serveru. |
| UsePrinter | 131080 | Právo přidat tiskové úlohy do fronty a odstranit a vytvořit výčet vlastních úloh. |
| 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. |
| 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. |
Příklady
Následující příklad ukazuje, jak pomocí tohoto výčtu nainstalovat druhou tiskárnu, která se liší ve vlastnostech existující tiskárny pouze v umístění, portu a sdíleném stavu.
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ší podle následujících:
Ať už je tiskovým serverem počítač nebo zařízení tiskového serveru.
Použitý operační systém.
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 každé úrovni přístupu, ale uvedené úrovně přístupu mohou poskytovat více nebo méně práv na konkrétních systémech.
Tyto hodnoty se primárně používají jako parametry pro PrintServer a PrintQueue konstruktory. 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 .