Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

API (Windows UserID & Computer Name) 3

Status
Not open for further replies.

janrachel

IS-IT--Management
May 29, 2001
4
0
0
BE
Please, can some one help me ?
i would like to know how to get the current user name by and the current computer name using an API method

Thx [sig][/sig]
 
Hi,

Public Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long

Public Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long


Hope it helps

Jimmy
 
Jimmy, do you know how to get an IP address of a user on a network by user/login name?
 
Hardcore, you would retrieve the IP after matching the user with a computer name. The address can be extracted fairly easily. Please post this question in the appropriate forum, since it is off-topic here.

Actually, the entire contents of this forum are off-topic. I just got tired of red-flagging every post. That isn't a very good way to foster discussion. Let's talk about this in the VB or C forums.
VCA.gif

Alt255@Vorpalcom.Intranets.com
Klatu barada nikto, y'all.
 
There is a FAQ with the complete solution:

faq222-429
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top