[英]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
Take a look at this article: Unify Windows Forms and ASP.NET Providers for Credentials Management . 请查看本文: 统一Windows窗体和ASP.NET提供程序以进行凭据管理 。
For even more information check out the links from this answer: http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/9e5192f4-4f44-4db6-aab8-8e79f2e667f8 . 有关更多信息,请查看以下答案中的链接: http : //social.msdn.microsoft.com/Forums/en-US/winforms/thread/9e5192f4-4f44-4db6-aab8-8e79f2e667f8 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.