GetUserName

J

jack

Hi everyone,

In VB.NET, is getting the network username still the same as VB 6.0, i.e.
using the the following API:
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA"
(ByVal lpBuffer As String, ByRef nSize As Integer) As Integer

Or, is there a way to do this using the .NET Framewrork?

Thanks!

Jack
 
H

Herfried K. Wagner [MVP]

jack said:
In VB.NET, is getting the network username still the same as VB 6.0, i.e.
using the the following API:
Private Declare Function GetUserName Lib "advapi32.dll" Alias
"GetUserNameA" (ByVal lpBuffer As String, ByRef nSize As Integer) As
Integer

Or, is there a way to do this using the .NET Framewrork?

'Environment.UserName'
'SystemInformation.UserName'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top