borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Messanger on LAN !!!)Next Topic (USB Port) New Topic New Poll Post Reply
AndreaVB Forum : API : how to get the current user on a domain
Poster Message
nani
Level: Trainee

Registered: 19-03-2005
Posts: 3

icon how to get the current user on a domain

Hi,
I'm currently working on a VB application This application will be Shared on a network .Each user on a client once he clicks on the shared application , i want the application to be able to retrieve the current user's id,meaning on every client machine this function will get a differnt user ID since it has a different user logged on the domain
My question is : using API functions can i get the id of the current user on a domain
I'm new to API functions and I want to Know if it will be useful to me.
If any one can recommend a Book on a API it would be kind of you

20-03-2005 at 01:29 PM
View Profile Send Email to User Show All Posts | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: how to get the current user on a domain

There is a API book by Dan Appleman, I cant remeber of any other...

____________________________
If you find the answer helpful, please mark this topic as solved.

22-03-2005 at 10:02 PM
View Profile Send Email to User Show All Posts | Quote Reply
omidk
Level: Protégé

Registered: 19-03-2005
Posts: 6
icon Re: how to get the current user on a domain

u ca use getcomputername api function
or
shell "net user"

09-08-2005 at 06:32 AM
View Profile Send Email to User Show All Posts | Quote Reply
TJ_01
Level: VB Lord


Registered: 24-08-2005
Posts: 320
icon Re: how to get the current user on a domain

Would this code helps?

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

Private Sub Form_Load()
Dim s As String
Dim cnt As Long
Dim dl As Long
Dim CurUser As String
cnt = 199
s = String$(200, 0)
dl = GetUserName(s, cnt)
If dl <> 0 Then CurUser = Left$(s, cnt) Else CurUser = ""
Label1.Caption = CurUser
End Sub






____________________________
Im JAMES  

24-08-2005 at 04:11 AM
View Profile Send Email to User Show All Posts | Quote Reply
Asim-GDI GURU
Level: Sage

Registered: 29-07-2005
Posts: 54
icon Re: how to get the current user on a domain

Yeah the book by Dan Appleman is the most ideal one to read for beginners.Its called Visual Basic's Programmers Guide to Win32 API.Another book that I think is the masterpiece on WIN32 GDI API is Windows Graphics Programming by Feng Yuan of Hewlett Packard.These are the must books one should have.

Regards,
Asim Siddiqui.

24-08-2005 at 02:46 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : API : how to get the current user on a domain
Previous Topic (Messanger on LAN !!!)Next Topic (USB Port) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder