是有可能的是,当我启动一个视窗形式应用,它会自动拾取从在窗口处的起始输入的凭证的用户名和密码,并自动登录用户。使用Windows窗体应用程序自动登录用户?
0
A
回答
0
拿起密码是永远不可能的,因为它是一个安全威胁。 。
根据您的WinForms应用程序编写语言,可能有几种方法来获得当前登录用户的用户名
在C#中,你可以这样说:
string username = Environment.UserName;
string domain = Environment.UserDomainName;
string fullyQualifiedUsername = domain + "\\" + username;
有一次,你有用户名,你可以假设用户在登录到机器时已经被认证。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using System.Activities.Statements;
public partial class sso : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string username = Request["username"];
FormsAuthentication.RedirectFromLoginPage(username, false);
}
}
然后,您可以调用页面这样:http://localhost/sso/sso.aspx?username=Varun+Chatterji
因此,你就可以绕过ASP.NET通过创建“日志中的”用户上面得到一个自定义页面表单认证免责声明:这是示例代码,不适用于生产。如果实现单独使用查询字符串以这种方式“登录”,则必须在sso.aspx
0
0
您可以随时检查,看看是否有一个有效的WindowsIdentity
:
using System.Security.Principal;
WindowsIdentity currUser = WindowsIdentity.GetCurrent();
if (currUser != null)
{
string userName = currUser.Name;
}
但人也说:你赢了无法检索密码 - 永远不会。
连接字符串和当前的Windows身份如果你想登录到SQL Server,你可以定义Integrated Security=SSPI;
将用于登录到SQL Server。没有密码需要这个。
相关问题
- 1. 获取用户的全名登录使用C#的Windows登录详细信息窗体应用程序
- 2. Windows窗体应用程序使用HTML
- 3. 如何在Windows登录异常窗体应用程序
- 4. Windows窗体应用程序
- 5. 使用Facebook用户登录我的Windows Phone 7应用程序
- 6. 用户使用智能卡登录Windows UWP应用程序
- 7. 我可以使用用户Windows登录自动登录到Web应用程序吗?
- 8. 使用MS Access获取Windows窗体中登录的用户
- 9. 自动登录应用程序
- 10. Web应用程序自动登录
- 11. iPhone应用程序自动登录
- 12. BlackBerry应用程序自动登录
- 13. 自动登录Facebook用户到应用程序
- 14. 谷歌应用程序 - 自动登录域用户
- 15. OSX应用程序商店和自动登录应用程序
- 16. 在Windows应用程序中自动登录
- 17. 自动化Windows应用程序登录操作
- 18. 自动CRUD表单生成.net Windows窗体应用程序
- 19. Windows使应用程序在系统启动时运行(用户登录)
- 20. 应用程序用户和SQL登录
- 21. 推荐使用Windows窗体应用程序的UI测试自动化工具
- 22. 如何使用MSAA自动化简单的Windows窗体应用程序?
- 23. 使用活动目录启用自动登录到瓶子应用程序
- 24. C#自动登录使用桌面应用程序的网站
- 25. 使用Windows服务从Windows窗体应用程序
- 26. 用户未登录时的Windows GUI应用程序?
- 27. 登录窗口应用程序
- 28. Windows窗体应用程序中的用户控件
- 29. WPF应用程序中的Windows窗体用户控件
- 30. 从.NET应用程序登录到Windows
登录到什么某种形式的认证安全登录?针对哪种用户需要验证凭据? – rene 2011-03-16 06:53:50
该应用程序必须在Intranet中使用。它将使用凭证登录,然后我将使用该应用与网站进行交互。 – Prachur 2011-03-16 06:58:58