用户名和密码 [英] username and password

查看:127
本文介绍了用户名和密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

:rose:如何通过.net应用程序从Windows XP OS中获取用户名和密码.帮助需求....

:rose:how to take the username and password from windows xp os through .net application. help need ....

推荐答案

谢谢您的提问.您无法获取密码.仅用户名.您可以通过以下代码模拟Windows XP用户的.NET应用程序.


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


这篇关于用户名和密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆