共用方式為


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"

備註

由於使用者名稱是以明文儲存,擁有正確憑證的認證使用者可以在伺服器所在的網域中讀取該名稱。

備註

出於安全考量,身份區塊支援儲存加密的 UserNamePassword

適用於