实现“记住我"的最佳方法WinForms/WPF中的复选框 [英] Best way to implement "Remember Me" check box in WinForms / WPF
问题描述
我想在我的WPF应用程序的登录表单中添加一个记住我"复选框.最好的方法是什么?
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?
当前,该应用程序通过Websevice调用登录,该调用返回已验证的令牌,该令牌用于后续调用.我是否应该简单地双向加密并将此令牌存储在文件系统中的某个位置?
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?
推荐答案
You could also store it in Isolated Storage or create a User setting in your application's Settings.
Oren关于使用DPAPI保护信息的建议是好的,但它没有存储任何内容:
Oren's suggestion of using DPAPI to protect information is well and good, but it doesn't store anything:
要记住的重要一点是DPAPI仅将加密保护应用于数据.它不存储任何受保护的数据;因此,调用DPAPI的应用程序必须实现自己的受保护数据存储.
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.
这篇关于实现“记住我"的最佳方法WinForms/WPF中的复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!