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

Environment.UserDomainName not working ?

Status
Not open for further replies.

StevenK

Programmer
Jan 5, 2001
1,294
GB
We've got ourselves a simple log in form which validates a user's windows log-on username / domain / password.
This has worked fine using the following code :

tbLogin.Text = Environment.UserName;
tbDomain.Text = Environment.UserDomainName;

Previously this would give us something like @
Login Name : User1
Domain Name : Domain1

We have recently changed over our servers and now have an issue whereby the domain name is now showing the local domain name in some cases (not all).
ie.
Login Name : User1
Domain Name : User1

Are we reading the correct values for the domain name of the user running the application ?
Or would a change in server set-up have caused this kind of impact ?

Any help would be appreciated.
Thanks in advance.

Steve.
 
The Environment is the right class to get these information.
If the application was working before some servers moving then when you are asked for the User name type :
DomainName\Username.

-obislavu-



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top