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.
Declare Function WNetGetUser& Lib "Mpr" alias "WNetGetUserA" (lpName As Any, ByVal lpUserName$, lpnLength&)
Public Function networkusername() As String
Dim ret As Long, buffer(512) As Byte, i As Integer
Dim wk101 As WKSTA_INFO_101, pwk101 As Long
Dim wk1 As WKSTA_USER_INFO_1, pwk1 As Long
Dim cbusername As Long
Dim computername As String, langroup As String, logondomain As String
' Clear all of the display values.
computername = "": langroup = "": networkusername = "": logondomain = ""
' Windows 95 or NT - call WNetGetUser to get the name of the user.
networkusername = Space(256)
cbusername = Len(networkusername)
ret = WNetGetUser(ByVal 0&, networkusername, cbusername)
If ret = 0 Then ' Success - strip off the null.
networkusername = Left(networkusername, InStr(networkusername, Chr(0)) - 1)
Else
networkusername = ""
End If
End Function
Public Function GetEnviron(Expression)
GetEnviron = VBA.Environ(Expression)
End Function