PrintSystemDesiredAccess Enumerazione

Definizione

Specifica i vari diritti (o livelli) di accesso per la stampa di oggetti.

public enum class PrintSystemDesiredAccess
public enum PrintSystemDesiredAccess
type PrintSystemDesiredAccess = 
Public Enum PrintSystemDesiredAccess
Ereditarietà
PrintSystemDesiredAccess

Campi

AdministratePrinter 983052

Diritto di eseguire tutte le attività amministrative relative alla coda di stampa, incluso il diritto di sospendere e riprendere qualsiasi processo di stampa e il diritto di eliminare tutti i processi dalla coda. Tale livello di accesso include anche tutti i diritti legati a UsePrinter.

AdministrateServer 983041

Diritto di eseguire tutte le attività amministrative relative al server di stampa. Tale livello di accesso non include diritti AdministratePrinter per le code di stampa ospitate dal server.

EnumerateServer 131074

Diritto di elencare le code sul server di stampa.

None 0

Nessun accesso.

UsePrinter 131080

Diritto di aggiungere processi di stampa alla coda e di eliminare ed enumerare i propri processi.

Esempio

Nell'esempio seguente viene illustrato come utilizzare questa enumerazione per installare una seconda stampante diversa dalle proprietà di una stampante esistente solo in posizione, porta e stato condiviso.

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

Commenti

I diritti di accesso disponibili a ogni livello di accesso variano in base ai seguenti:

  • Indica se il server di stampa è un computer o un'appliance server di stampa.

  • Sistema operativo utilizzato.

  • Aggiornamenti della sicurezza installati.

  • Criteri di sicurezza supportati.

Per questo motivo, le descrizioni dei diritti di accesso nella sezione "Membri" sono tipiche dei diritti che corrispondono a ogni livello di accesso, ma i livelli di accesso elencati possono fornire più o meno diritti per determinati sistemi.

Questi valori vengono usati principalmente come parametri per PrintServer i costruttori e PrintQueue . I costruttori genereranno eccezioni se si usa un valore che può essere applicato solo a un altro tipo di oggetto. Ad esempio, non passare AdministratePrinter a un PrintServer costruttore.

Si applica a