验证用户名&密码 [英] validate username & password

查看:119
本文介绍了验证用户名&密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以开发员工数据库.我使用Vb.net作为前端,使用ms访问作为后端.在单个数据库表中,我包括所有员工信息(以及用户ID和密码).我为员工放置了单独的登录表单.每个人都有单独的日志ID和密码.我尝试构建登录表单.但是没有连接.
我需要帮助...........

Hi, I could developed employee database.I use Vb.net as front end and ms access as back end. In single database table i include all employee information (also user id and password). I placed separate log in form for employee. Each person has separate log id and password. I try to structure log in form. But its not connected.
I want help ...........

推荐答案

您真的不希望将表单连接到数据库:您想等待用户按下确定"或登录"按钮,然后验证数据.
正常过程是将散列密码保存在数据库中(MD5,最好是SHA),并检索具有匹配登录ID的记录.然后,根据他们输入的数据(ID和密码)生成哈希并将其与数据库返回的值进行比较.如果匹配,则可以登录;如果不匹配,则可以登录.

这里有一个涵盖了散列的链接-它是C#语言,但翻译起来很容易:
You don''t really want the form connected to the database: you want to wait for the user to press the "OK" or "Login" buttons, then validate the data.
The normal procedure is to hold a hashed password in the database (MD5 or preferably SHA) and retrieve the record which has a matching login id. You then generate the hash from the data they have entered (id and password) and compare that to the value returned from the DB. If it matches, they they are ok to login, if it doesn''t they aren''t.

There is a link here which covers the hashing - it''s in C# but it translates easily: Password Storage: How to do it.[^]


这篇关于验证用户名&密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆