string = WNetGetUser(connection)

Retrieves the current default user name, or the user name used to establish a network connection.


connection=None : string

A string that specifies either the name of a local device that has been redirected to a network resource, or the remote name of a network resource to which a connection has been made without redirecting a local device. If this parameter is None, the system returns the name of the current user for the process.