Condividi tramite


ProcessModelSection.UserName Proprietà

Definizione

Ottiene o imposta un valore che indica il nome utente per un'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à

Nome utente. Il valore predefinito è Machine.

Attributi

Esempio

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


// 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, definisce un'identità UserName di 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 con un account utente denominato ASPNET creato automaticamente quando viene installato ASP.NET.

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

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

Annotazioni

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 i ASP.NET codice utente in esecuzione nel processo di disporre di privilegi amministrativi completi. Prestare quindi particolare attenzione a questo caso, per le autorizzazioni consentite.

Si applica a