Private Sub Command1_Click()
中方ssl适用于网站、小程序/APP、API接口等需要进行数据传输应用场景,ssl证书未来市场广阔!成为成都创新互联的ssl证书销售渠道,可以享受市场价格4-6折优惠!如果有意向欢迎电话联系或者加微信:18982081108(备注:SSL证书合作)期待与您的合作!
Static i As Integer
If Text1.Text = "" And Text2.Text = "" Then
MsgBox "请输入用户名和密码", vbOKOnly, "提示"
Text1.SetFocus
Exit Sub
End If
If Text1.Text = "admin" And Text2.Text = "admin" Then
MsgBox "用户名密码正确", vbOKOnly, "提示"
i = 0
Else
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
Text1.SetFocus
If i 3 Then
MsgBox "用户名或密码错误,请重新输入", vbOKOnly, "提示"
i = i + 1
End If
If i = 3 Then
MsgBox "输入3次错误用户名或密码,程序将退出", vbOKOnly, "提示"
Unload Me
End If
End If
End Sub
Private Sub Form_Load()
Label1.Caption = "用户名"
Label2.Caption = "密 码"
Text1.Text = ""
Text2.Text = ""
Text2.PasswordChar = "*"
Command1.Caption = "确定"
End Sub
你去学习如何建立窗体,如何调出窗体,隐藏窗体,等等,就可以了。如果这个些不会,你就没法做成注册的。
创建完相应的用户名,密码控件之后,输入以下代码:
Imports System.Data.OleDb
Public Class Form1
Private Sub cmdok_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdok.Click
Dim m_username As String
Dim m_userpwd As String
Dim cmd_result As MsgBoxResult
Dim m_da As New OleDbDataAdapter
Dim m_ds As New DataSet
Dim m_command As New OleDbCommand
Dim strsql As String
m_username = txtusername.Text
m_userpwd = txtuserpwd.Text
strsql = " select * from user_info where username='" m_username "' and userpwd='" m_userpwd "'"
OleDbConnection1.Open()
m_command.CommandType = CommandType.Text
m_command.CommandText = strsql
m_command.Connection = OleDbConnection1
m_da.SelectCommand = m_command
m_da.Fill(m_ds, "user_info")
If m_ds.Tables("user_info").Rows.Count 0 Then
cmd_result = MsgBox("欢迎登录", MsgBoxStyle.OKOnly, "提示")
Else
MsgBox("登录失败,请确认用户名和密码")
End If
End Sub
End Class
用格式转换器(格式工厂)把ico格式转换成其他可识别的格式
然后在添加
下一步(你的意思是要在界面设计中 往窗体上添加工具栏吗?)
工具箱中 ---- 菜单和工具栏 ----- MenuStrip
窗体上方出现 '请再次键入'(vs2010中) 的框框 点一下就可以放"打开"什么的了
右面属性中找到Image属性.可以更改你自己的图片了.
知道了吗?
还有疑问你就追问 ````赫赫
1.首先添加2个label控件,一个caption为用户名,一个为密码然后分别在2个label控件后面添加一个text控件,
2.将text的text属性设置为空再添加2个button按钮,一个名为登陆,一个名为取消简要代码如下:
private sub text2_change() sswordchar="*"end subprivate sub button1_click()if text1.text="text" and text2.text="123456" then '这里写验证代码... '通过验证后要干么elsemsgbox("用户名或者密码不正确!")end if end subprivate sub button2_click()endend sub