简体   繁体   English

使用ASP.net凭据从WinForms应用程序登录

[英]Using ASP.net credentials to log in from a WinForms application

We have an ASP.net application but some screens are deemed too slow to use by our users. 我们有一个ASP.net应用程序,但我们的用户认为某些屏幕太慢而无法使用。 As a result, we are trying to provide a WinForms-based alternative to those data-input centric screens so we can use richer controls like Grids with immediate screen updates and feedback for the user. 因此,我们正在尝试为那些以数据输入为中心的屏幕提供基于WinForms的替代方案,以便我们可以使用更丰富的控件(如网格),并立即对用户进行屏幕更新和反馈。

Ideally, I would like the users to login to the WinForms application using the same credentials they use in the ASP.net application? 理想情况下,我希望用户使用他们在ASP.net应用程序中使用的相同凭据登录到WinForms应用程序?

Is it possible? 可能吗? I've found this post ( .Net authentication for both web and winforms ) but it isn't really answering the question from my point of view... We are not using WebServices, or WCF at the moment and do not plan to use it unless it is really the only way to achieve this. 我发现这篇文章( .Net和winforms的.Net身份验证 ),但从我的角度来看它并没有真正回答这个问题......我们目前没有使用WebServices或WCF,也不打算使用除非它真的是实现这一目标的唯一途径。

Thanks a lot. 非常感谢。

Sure you can, just add the same settings in your app.config that you have in your web.config to wire up the Membership provider, and reference System.Web.Security. 当然可以,只需在web.config中添加相同的设置,即连接成员资格提供程序,并引用System.Web.Security。 Then you can use Membership and Roles from your WinForms application. 然后,您可以使用WinForms应用程序中的成员资格和角色。

See this article for a good example of how to do this: http://www.theproblemsolver.nl/usingthemembershipproviderinwinforms.htm 有关如何执行此操作的一个很好的示例,请参阅此文章: http//www.theproblemsolver.nl/usingthemembershipproviderinwinforms.htm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从ASP.NET网站更新我的WinForms应用程序 - How to update my WinForms application from ASP.NET website 使用经过身份验证的用户凭据从asp.net启动控制台应用程序 - Starting a console application from asp.net using authenticated user credentials 在ASP.NET中使用Winforms MessageBox的问题 - Issue Using Winforms MessageBox in ASP.NET 在IIS下的ASP.net网站中使用C#从Windows通用凭据存储中检索凭据 - Retrieve Credentials from Windows generic Credentials Store using C# in ASP.net website under IIS 在 IIS 下的 ASP.net 网站中使用 C# 从 Windows Credentials Store 检索凭据 - Retrieve Credentials from Windows Credentials Store using C# in ASP.net website under IIS 使用Log4Net记录ASP.NET和C#应用程序中调用的所有功能 - Using Log4Net to log all the functions called in ASP.NET and C# application 如何自动登录到asp.net应用程序 - How to automatically log on to asp.net application ASP.NET Web应用程序审核日志 - ASP.NET Web Application Audit Log 如何通过交互式提供凭据从 asp.net web forms 应用程序连接到 Azure Active Directory? - How to connect to Azure Active Directory from asp.net web forms application by providing credentials interactively? 在Winforms和ASP.NET中重构 - Refactoring in Winforms and ASP.NET
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM