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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get the logged in user?

Status
Not open for further replies.

bigfoot

Programmer
May 4, 1999
1,779
US
I am creating a windows application where some users will not be able to run the application, and some will have supervisory rights.

What's the best way to do this in vb.net?

Gary can use the program.
Jill can not.
Jim can use the program but he gets more menu choices then Gary.

I was going to have them log into the program, but then I thought about retrieving their user name from the XP system they are currently on. Everyone has his own PC.

Would I keep a database somewhere for who can use the program, or can I use Active Directory somehow.

This is my first production app in .net. VB6 was much easer for me.

Any help would be great.

Thanks
Gary
 
Cool. Thanks. I just also found a sample project in 101 .NET projects.
 
bigfoot,

this is what i used to get logged in user and computer name works quick and easy.
Public gstrUserName As String = System.Windows.Forms.SystemInformation.ComputerName.ToString & "\" & System.Windows.Forms.SystemInformation.UserName.ToString

hth,
Bueller
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top