
正文
关于vb.net密码提示框的信息
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
vb.net若要设计一个要求用户输入密码登陆界面则接受用户密码输入可使用的最佳
Try
Conn = New SqlConnection("Data Source = ASTRAYBI-PC;Initial Catalog = Attendsystem;" "Integrated Security = false; User ID=sa;Password=********")
Conn.Open()
Comm = New SqlCommand("pwd_CheckPass", Conn)
Comm.CommandType = CommandType.StoredProcedure
Comm.Parameters.Add("@CHKName", SqlDbType.VarChar, 30).Value = TBuser.Text
Comm.Parameters.Add("@CHKPass", SqlDbType.VarChar, 10).Value = TBpwd.Text
Comm.Parameters.Add("@ISValid", SqlDbType.VarChar, 20).Direction = ParameterDirection.Output
Comm.ExecuteNonQuery()
If Comm.Parameters("@ISValid").Value = "Good" Then
MessageBox.Show("Welcome!")
Attendsys.Show()
Me.Hide()
Else
MessageBox.Show("Wrong Password Or Unexisted User!")
End If
Catch ex As Exception
MessageBox.Show(ex.ToString())
End Try
具体步骤是建立数据库连接,赋值textbox控件,验证!
相关问答
Q1: VB.NET用户登录,账号密码正确,却提示密码错误!
Private Sub BtOk_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Btok.Click
Dim con As OleDbConnection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Admin.accdb;Persist Security Info=True")
Dim com As OleDbCommand = New OleDbCommand("select * from 用户名", con)
con.Open()
Dim h1 As OleDbDataReader
Dim table As New DataTable
h1 = com.ExecuteReader()
table.Load(h1)
If txtName.Text = "" Then
MsgBox("请输入用户名", MsgBoxStyle.OkCancel + MsgBoxStyle.Exclamation, "错误提示")
ElseIf txtName.Text "" And txtPasswd.Text = "" Then
MsgBox("请输入密码", MsgBoxStyle.OkCancel + MsgBoxStyle.Exclamation, "错误提示")
ElseIf table.Select("用户名='" txtName.Text "'").Length 0 Then
If table.Select("用户名='" txtName.Text "'")(0)("密码").ToString = txtPasswd.Text Then
MsgBox("成功登陆", MsgBoxStyle.OkCancel + MsgBoxStyle.Exclamation, "错误提示") Then
Form1.Show()
Me.Visible = False
Exit Sub
Else
MsgBox("密码错误", MsgBoxStyle.OkCancel + MsgBoxStyle.Exclamation, "错误提示")
End If
Else
MsgBox("用户名不存在", MsgBoxStyle.OkCancel + MsgBoxStyle.Exclamation, "错误提示")
Exit Sub
End If
table.Clear()
h1.Close()
con.Close()
End Sub
Q2: VB.net中怎么让combobox作为密码框输入呢,意思里面的内容以*号显示
你描述的有问题吧?
如果是以combobox作为密码输入框,密码是可供选择的,显示*号的话,客户是无法选择的。
你说的应该是让Textbox作为密码输入框吧?
Q3: vb.net文本框设置密码如何隐藏
你是说如何把密码框输入的内容变成类似“*”?
在视图窗口,点击文本框,在右侧的属性栏里有一个属性是“passwordChar”
你给设置成想要的隐藏的字符就行,类似于“*”
希望能对你有帮助。
Q4: 用vb.net怎么样输入密码时显示****
例如:TextBox控件,只要在属性窗口将 PasswordChar 设置为你想要显示的符号即可。如“*”、“?”等
Q5: 使用VB.net作个登录界面,怎样在用户名或密码错误情况下弹出合适的提示框?
msgbox就可以,很大一部分就是msgbox做的。
或者可以添加一个红色标签,用来提示输入错误并清空密码输入框。







