次の方法で共有


User2.LoginName プロパティ

定義

ユーザーの完全な資格情報を取得します。

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

プロパティ値

domain\username という形式のユーザーの資格情報。

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

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

注釈

LoginName プロパティは、ユーザーの資格情報を domain\username として返します。 ユーザーのアカウントがドメインに属していない場合は、username のみを返します。

これは、System.Environment.UserDomainName+"\\"+System.Environment.UserName を呼び出すのと同等です。

適用対象