User2.UserName 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
仅获取用户的用户名。
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 的效果相同。