Net.User$ (property)


Net.User$ [([LocalName])]


Returns the name of the user on the network.


A runtime error is generated if the network is not installed.

The LocalName parameter is the name of the local device that the user has made a connection to. If this parameter is omitted, then the name of the current user of the process is used.

If Localname is a network name and the user is connected to that resource using different names, the network provider may not be able to resolve which user name to return. In this case, the provider may make an arbitrary choice from the possible user names.


Sub Main()

  'This example tells the user who he or she is.

  MsgBox "You are " & Net.User$

  'This example makes sure this capability is supported.

  If Net.GetCaps(4) And 1 Then MsgBox "You are " & _

End Sub

More information