Subscribe to Subscribers
Talk to Webmaster Tony John

Online Members

Phagu Mahato
More...


Forums » .NET » .NET »

How to get windows user id in c# windows application (asp.net 2.0)?


Posted Date: 03 Jun 2009      Posted By:: senthilvijay     Member Level: Bronze    Member Rank: 5568     Points: 1   Responses: 2



How to get windows user ID in C# windows application (asp.net 2.0)?
I would like to Know How many users are login to working in my products.

Regards,
senthil




Responses

#384924    Author: Narendra Reddy vajrala      Member Level: Gold      Member Rank: 164     Date: 03/Jun/2009   Rating: 2 out of 52 out of 5     Points: 2

one of the way is maintaining one more field in usertable.
when the user loggedin made that column to 1 when user in off update that to 0

if you want to get the number of using users
select sum(flag) from user_table, it will give you the active users.

--Naren
----------
Jai Sri Ram



 
#384929    Author: Satish Kumar J      Member Level: Gold      Member Rank: 30     Date: 03/Jun/2009   Rating: 2 out of 52 out of 5     Points: 2

You can use System.Environment.UserName to get logged in User name


MessageBox.Show(System.Environment.UserName);


another way


System.Security.Principal.WindowsIdentity identity = System.Security.Principal.WindowsIdentity.GetCurrent();
MessageBox.Show(identity.Name);


HTH

Regards,
Satish
My Blog



 
Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.



Next : Exceptions thrown by a method
Previous : Exceptions thrown by a method
Return to Discussion Forum
Post New Message
Category:

Related Messages



Follow us on Twitter: https://twitter.com/dotnetspider

Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
2005 - 2012 All Rights Reserved.
.NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
Articles, tutorials and all other content offered here is for educational purpose only.
We are not associated with Microsoft or its partners.