Hi,
Dear elaborate the question , what is ur requirementwhich one user you want to dected windows login credetial, sql regiserted useror want to detect user login thatare save ina custom user table on Sql server.
if you want to capture the windows login user use the following code, and save the login user name into a static variable that is having application scope.
WindowsIdentity wi = WindowsIdentity.GetCurrent(); bool IsAuthenticated = wi.IsAuthenticated; string LoginUserName = wi.Name.ToUpper();
u can could the following code also to get user string strUser = Environment.UserName;
In other case if your login persmission save into dateTable on Sql Server , just authenticate the login user into database table if it is authenticated and then same the current user into a static variable.
Good Luck.
- Marked As Answer byjacobsdesigns Friday, August 07, 2009 4:48 PM
-
|