Share via


IdentitySection.UserName 属性

定义

获取或设置一个值,该值指示用于模拟的用户名。

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

属性值

要用于模拟的用户名。

属性

示例

下面的代码示例演示如何访问 UserName 属性。 请参阅 类的 IdentitySection 代码示例,了解如何访问 节。

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

// Set the UserName property value.
identitySection.UserName = "userName";
' Get the UserName property value.
Dim currentUserName As String = identitySection.UserName

' Set the UserName property value.
identitySection.UserName = "userName"

注解

由于用户名以明文形式存储,因此在服务器所在的域中具有适当凭据的经过身份验证的用户可以读取该用户名。

注意

出于安全原因,标识部分支持存储加密 UserName 的 和 Password

适用于