Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
'used for machine name
Declare Function WNetGetUserA Lib "mpr" (ByVal lpName As String, ByVal lpUserName As String, lpnLength As Long) As Long
Declare Function GetComputerNameA Lib "kernel32" (ByVal lpBuffer As String, nSize As Long) As Long
=================================================
Function GetUserID() As String
Dim sUserNameBuff As String * 255
sUserNameBuff = Space(255)
Call WNetGetUserA(vbNullString, sUserNameBuff, 255&)
GetUserID = Left$(sUserNameBuff, InStr(sUserNameBuff, vbNullChar) - 1)
End Function
=============================================
Function GetWSID() As String
Dim sBuffer As String * 255
Dim X As Long
If GetComputerNameA(sBuffer, 255&) > 0 Then
GetWSID = Left$(sBuffer, InStr(sBuffer, vbNullChar) - 1)
Else
GetWSID = "?"
End If
=================================
Sub displayUser()
MsgBox GetUserID & ", " & GetWSID
End Sub