Link to home
Create AccountLog in
Avatar of arnold739
arnold739

asked on

How do you extract the Windows User ID to Display on a Windows Form Project in Visual Studio using Visual Basic code?

How do you extract the Windows User ID to Display on a Windows Form Project in Visual Studio using Visual Basic code?
Avatar of arnold739
arnold739

ASKER

I might be missing the obvious. I am a VB rookie.
Avatar of Éric Moreau
you can try: MessageBox.Show(Environment.UserName)
Yes that works, thanks, BUT I would like the ID to appear in a Text Box on the Form. Sorry, I should have provided more detail.  
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
OK I figure it out :
 UserIDTextBox.Text = (Environment.UserName)
Thanks for the Tip