Condividi tramite


ProcessModelSection.UserName Proprietà

Definizione

Ottiene o imposta un valore che indica il nome utente per l'identità di Windows.

public:
 property System::String ^ UserName { System::String ^ get(); void set(System::String ^ value); };
[System.Configuration.ConfigurationProperty("userName", DefaultValue="machine")]
public string UserName { get; set; }
[<System.Configuration.ConfigurationProperty("userName", DefaultValue="machine")>]
member this.UserName : string with get, set
Public Property UserName As String

Valore della proprietà

String

Nome utente. Il valore predefinito è Machine.

Attributi

Esempio

Nell'esempio di codice seguente viene illustrato come accedere alla proprietà UserName.


// Get the current UserName property value.
string userName = 
  processModelSection.UserName;

// Set the UserName property to "CustomUser".
processModelSection.UserName = "CustomUser";
' Get the current UserName property value.
   Dim userName As String = _
   processModelSection.UserName

' Set the UserName property to "CustomUser".
processModelSection.UserName = "CustomUser"

Commenti

Se presente, l'oggetto UserName definisce un'identità Windows diversa da quella del processo predefinito. Questa identità viene usata per eseguire il processo di lavoro ASP.NET.

Per impostazione predefinita, UserName è impostato sul valore speciale Machine e il processo viene eseguito in un account utente denominato ASPNET creato automaticamente quando viene installato ASP.NET.

La Password proprietà deve essere usata con la UserName proprietà .

Quando presente, questi valori di proprietà causano l'esecuzione del processo di lavoro con l'identità configurata Windows.

Nota

Se la UserName proprietà è impostata su System, con la password AutoGenerate, definisce un'entità che esegue il processo come account amministrativo e consente a tutti ASP.NET codice utente in esecuzione nel processo di avere privilegi amministrativi completi. Quindi, prestare attenzione a questo caso, per le autorizzazioni consentite.

Si applica a