IdentitySection.UserName Property

Definition

Gets or sets a value indicating the user name to use for impersonation.

C#
[System.Configuration.ConfigurationProperty("userName", DefaultValue="")]
public string UserName { get; set; }

Property Value

The user name to use for impersonation.

Attributes

Examples

The following code example shows how to access the UserName property. Refer to the code example of the IdentitySection class to learn how to access the section.

C#
// Get the UserName property value.
string currentUserName = identitySection.UserName;

// Set the UserName property value.
identitySection.UserName = "userName";

Remarks

Because the user name is stored in clear text, an authenticated user with proper credentials on the domain where the server resides can read it.

Note

For security reasons, the identity section supports storage of the encrypted UserName and Password.

Applies to

Produit Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1