vb.net数据库密码 vbnet des加密( 二 )


Dim pw As New MD5EnCode(13, 19)' '2次加密
sql = "select 权限组号,ID , 密码 from 编辑人数据 where 编辑姓名='" + TextBox1.Text + "'"
Dim aa As Data.OleDb.OleDbDataReader '= cmd.ExecuteReader
aDB.ExecAccessString(sql, aa)
If aa.Read() Then
'密码正确()
'sql = aa(2)'需要特别注意:只能单向解密,不能直接转换
mypw = pw.simDeCode(pw.simDeCode(aa(2)))
If TextBox2.Text = mypw Then
Session("LOGIN_Name") = TextBox1.Text'设置登录后的用户名称
Session("Login_Group") = aa(0)'cmd.ExecuteScalar'设置登录后的权限级别
Session("Login_ID") = aa(1)'cmd.ToString
'cmd = Nothing
'conn.Close()
Call wl.NewLog("登录", "管理员成功登录")
Response.Redirect("../WebManages/Default.ASPX")
Else
'密码错误()
sql = sql.Replace("'", "【单引号】")
sql = sql.Replace(",", "【逗号】")
Call wl.NewLog("登录", "管理员失败的登录", TextBox1.Text, sql.Replace("""", "【双引号】"), "")
Label4.Visible = True
End If
Else
'密码错误()
sql = sql.Replace("'", "【单引号】")
sql = sql.Replace(",", "【逗号】")
Call wl.NewLog("登录", "管理员失败的登录", TextBox1.Text, sql.Replace("""", "【双引号】"), "")
Label4.Visible = True
End If
End If
End Sub
VB.net中如何调用带密码的Access数据库"Provider=Microsoft.jet.oledb.4.0;data source=""含路径的数据库文件"";Persist Security Info=False
;jet oledb:database password=""数据库密码"
vb.net 如何修改access数据库文件的密码If Trim(ypsw.Text) = "" Then
MsgBox("原密码不能为空!", MsgBoxStyle.Critical)
ElseIf Trim(xpsw.Text) = "" Then
MsgBox("新密码不能为空!", MsgBoxStyle.Critical)
ElseIf Trim(qpsw.Text)Trim(xpsw.Text) Then
MsgBox("确认密码与新密码不一致!", MsgBoxStyle.Critical)
Else
Dim mycon As New OleDbConnection
mycon.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="Application.StartupPath"\data\Datas.mdb"
mycon.Open()
Dim mycmd As New OleDbCommand
mycmd.CommandText = "select * from 管理员 where 用户名='admin' and 密码='"ypsw.Text" '"
mycmd.Connection = mycon
Dim myada As New OleDbDataAdapter
myada.SelectCommand = mycmd
Dim myda As New DataSet
myada.Fill(myda, "yh")
If myda.Tables("yh").Rows.Count1 Then
MsgBox("您输入的原密码不正确,请重新输入!", MsgBoxStyle.Critical)
ypsw.Focus()
Else
mycmd.CommandText = "update 管理员 set 密码='"Trim(ypsw.Text)" '"
mycmd.ExecuteNonQuery()
MsgBox("密码修改成功!", MsgBoxStyle.Information)
End If
End If
关于vb.net数据库密码和vbnet des加密的介绍到此就结束了 , 不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息 , 记得收藏关注本站 。

推荐阅读