Επεξεργασία

Κοινή χρήση μέσω


ProcessModelSection.UserName Property

Definition

Gets or sets a value indicating the user name for a Windows identity.

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

Property Value

The user name. The default value is Machine.

Attributes

Examples

The following code example shows how to access the UserName property.


// 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"

Remarks

If present, the UserName defines a Windows identity different from that of the default process. This identity is used to run the ASP.NET worker process.

By default, UserName is set to the special value Machine, and the process runs under a user account named ASPNET that is created automatically when ASP.NET is installed.

The Password property must be used with the UserName property.

When present, these property values cause the worker process to run with the configured Windows identity.

Note

If the UserName property is set to System, with the password AutoGenerate, it defines an entity that runs the process as an administrative account and allows all ASP.NET user code running under the process to have full administrative privileges. So, pay close attention to this case, for the permissions allowed.

Applies to