Best way to implement “Remember Me” check box in WinForms / WPF

匆匆过客 提交于 2019-12-05 02:28:17

问题


I want to add a "Remember Me" check box to the login form of my WPF App. What's the best way to do this?

Currently the app logs in via a websevice call that returns an authenticated token that it uses for subsequent calls. Should I simply two-way encrypt and store this token somewhere in the files system?


回答1:


You could also store it in Isolated Storage or create a User setting in your application's Settings.

Edit: Oren's suggestion of using DPAPI to protect information is well and good, but it doesn't store anything:

An important point to remember is that DPAPI merely applies cryptographic protection to the data. It does not store any of the protected data; therefore applications calling DPAPI must implement their own storage of the protected data.




回答2:


Use the DPAPI. See also How to store passwords in Winforms application?.



来源:https://stackoverflow.com/questions/1244578/best-way-to-implement-remember-me-check-box-in-winforms-wpf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!