密码保护 Winforms 应用程序中的单个表单 (VB.NET)
我有一个使用 SQLite 数据库的 winforms 应用程序。数据库没有加密(数据必须与其他用户共享)。它是一个具有独立本地数据库的独立应用程序。
我遇到的困难是当人们将所有数据整合在一起时。数据库已连接,数据已导入,但记录通过数据库 GUID 进行区分。
无论如何,我希望有一个受密码保护的数据库选择屏幕,以防止用户错误地切换数据库(以及针对恶意使用的某种程度的保护)。
认为将密码存储在未加密的数据库中可能不是一个特别好的主意。安全性并不是一个大问题,因为它仅分发给需要该软件的用户。
当用户尝试访问数据库选择屏幕时,让用户输入密码的最佳方法是什么? ShowDialog? 弹出一个带有密码 TextBox 的新子表单,然后打开验证(通过按钮?)关闭密码表单并打开受保护的表单?
我看到了很多关于保护整个应用程序的内容,但很少看到关于保护特定表单的内容。
I've a winforms application that is using SQLite database. There is no encryption on the database (data has to be shared with other user). It is a stand alone application with a stand alone local database.
The difficulty I'm encountering is when people go to bring all the data together. The databases are attached, data imported, but records are differentiated by a database GUID.
At any rate I am desiring to have a database selection screen that is protected by a password to prevent users mistakenly switching databases (and some level of protection against malicious use).
Thinking it's probably not a particularly good idea to store the password in an unecrypted database. Security is not a large issue as this is only distributed to users that need the software.
What would be the best method to have the user type a password when they attempt to access the database selection screen? ShowDialog? Pop open a new child form with a password TextBox, then on validation (via button?) close the password form and open the protected form?
I see a fair bit about protecting a whole application, but not so much about a specific form.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为最好的选择是在调用显示表单之前立即显示一个对话框(可以像输入框或整个表单一样简单)。
在我看来,最好的做法是在尽可能靠近原点的地方拦截动作。这使您不必打开和关闭表单,并且总的来说,我认为提供了更好的用户体验。
I think that your best option is to show a dialog (could be as simple as an input box or a whole form) immediately before the call to show the form.
In my mind, it is always best to intercept the action as close to point of origin as possible. This prevents you from having to open and shut the form and, in general, I think provides a better user experience.