Click here to Skip to main content
15,891,204 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
:rose:how to take the username and password from windows xp os through .net application. help need ....
Posted
Updated 10-Dec-10 19:43pm
v2
Comments
[no name] 27-Nov-11 22:07pm    
Research on ActiveDirectory class of .NET

1 solution

Thank you for your question. You cannot get password. User Name only. You can impersonate Windows XP user for .NET application by the bellow code.


System.Security.Principal.WindowsImpersonationContext impersonationContext;
impersonationContext = 
    ((System.Security.Principal.WindowsIdentity)User.Identity).Impersonate();

//Insert your code that runs under the security context of the authenticating user here.

impersonationContext.Undo();



Thanks,
Mamun
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900