iFIX 获取用户名和组名

获取用户名和组名的方法(调度的后台执行)

调度程序设置为后台执行,并且设定好刷新时间为1秒

Private Sub FixTimer3_OnTimeOut(ByVal lTimerId As Long)

 

On Error GoTo errdata

Dim sUserID As String

Dim sUserName As String

Dim sGroupName As String

System.FixGetUserInfo sUserID, sUserName, sGroupName

 

Dim WrkSpcApp As Object

Set WrkSpcApp = GetObject(“”, “Workspace.Application”)

 

‘ Get a pointer to the Variable object called Variable1 in the User globals

Dim TargetVar As Object

Set TargetVar = WrkSpcApp.Documents(“xudajun_username”).Page.FindObject(“TextBox1”)

TargetVar.Text = sUserName

Set TargetVar = WrkSpcApp.Documents(“xudajun_username”).Page.FindObject(“TextBox2”)

TargetVar.Text = sGroupName

errdata:

Exit Sub

 

End Sub

获取用户名和组名的方法(属性)

关于用户名和用户组以下两个属性

System.LoginUserFullName

用户的登陆全称

System. LoginGroup

用户所属的首个组名

徐大军

发表评论

电子邮件地址不会被公开。 必填项已用*标注