2007-12-27 10:00:19耶 ♥

VB 帳號登入

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
’設定帳號 假設帳號錯誤的結果

If TextBox1.Text <> "ykvs" Then
MsgBox("帳號錯誤", MsgBoxStyle.Critical)
TextBox1.Text = ("")


Exit Sub
End If


’設定密碼 假設密碼錯誤的結果

If TextBox2.Text <> "2345" Then
MsgBox("密碼錯誤", MsgBoxStyle.Critical)
TextBox2.Text = ("")
Exit Sub
End If


’帳號密碼正確

MsgBox("歡迎登入", MsgBoxStyle.Information)


End Sub


Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox1.Text = ""
TextBox2.Text = ""

End Sub