简体   繁体   中英

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. 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.

Ideally, I would like the users to login to the WinForms application using the same credentials they use in the ASP.net application?

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.

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. Then you can use Membership and Roles from your WinForms application.

See this article for a good example of how to do this: http://www.theproblemsolver.nl/usingthemembershipproviderinwinforms.htm

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM