User2.UserName プロパティ

定義

ユーザーのユーザー名のみを取得します。

public:
 property System::String ^ UserName { System::String ^ get(); };
public string UserName { get; }
member this.UserName : string
Public ReadOnly Property UserName As String

プロパティ値

ユーザーのユーザー名。

次の例では、UserName プロパティを使用して、現在のユーザーのログイン資格情報を表示しています。

User2 thisUser = thisApplication.User;
thisXDocument.UI.Alert(thisUser.UserName);
Dim thisUser As User2  = thisApplication.User
thisXDocument.UI.Alert(thisUser.UserName)

注釈

UserName プロパティを呼び出すことは、System.Environment.UserName を呼び出すことと同じです。

適用対象