标题:[分享]在VB中,实现修改密码的功能
只看楼主
huyinhao2
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2007-10-25
 问题点数:0 回复次数:0 
[分享]在VB中,实现修改密码的功能
Private Sub Command1_Click()
Dim getmima As String, J As Integer, mima As String
'取得密码
With Adodc1
.ConnectionString = conn
.CommandType = 8
.RecordSource = "select * from login where username='" & userlogo & "'"
.Refresh
getmima = .Recordset.Fields("pass")
End With
'检确认密码与新密码是否一致
If Trim(Text1(2).Text) <> Trim(Text1(1).Text) Then
MsgBox "您输入的新密码与确认密码不符,请重新输入! ", vbExclamation, "提示"
Text1(1).Text = ""
Text1(2).Text = ""
Text1(1).SetFocus
Else
If DigestStrToHexStr(Text1(0)) = getmima Then
With Adodc1
.Recordset.Fields("pass") = DigestStrToHexStr(Text1(1))
.Recordset.Update
End With
MsgBox "非常好!密码已经修改完毕。请您牢记! ", vbExclamation, "提示"
Unload Me
Else
MsgBox "原密码不对,请确认后继续! ", vbExclamation, "提示"
Text1(0).Text = ""
Text1(1).Text = ""
Text1(2).Text = ""
Text1(0).SetFocus
End If
End If
End Sub



哈哈
搜索更多相关主题的帖子: 密码 分享 
2007-11-03 10:55



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-183096-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.401427 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved