求助

前端之家收集整理的这篇文章主要介绍了求助前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

@H_404_3@

Dim vCode As String@H_404_3@

Private Sub Command1_Click()@H_404_3@

drawvc@H_404_3@

End Sub@H_404_3@


Private Sub drawvc() '显示校验码@H_404_3@

Dim i,vc,px,py As Long@H_404_3@

Dim r,g,b As Byte@H_404_3@

Randomize '初始化随机种子
'生成随机校验码
vc = CLng(8999 * Rnd + 1000)@H_404_3@

vCode = vc
'显示校验码
Picture1.Cls@H_404_3@

Picture1.Print vc
'添加噪点(防止自动图像识别)@H_404_3@

For i = 0 To 2000 '画2000个噪点
'画点随机位置@H_404_3@

px = CLng(Picture1.Width * Rnd)@H_404_3@

py = CLng(Picture1.Height * Rnd)
'画点随机颜色
r = CByte(255 * Rnd)@H_404_3@

g = CByte(255 * Rnd)@H_404_3@

b = CByte(255 * Rnd)@H_404_3@

Picture1.Line (px,py)-(px + 1,py + 1),RGB(r,b)@H_404_3@

Next@H_404_3@

End Sub@H_404_3@

Private Sub Form_Load()@H_404_3@

Text1.Text = ""@H_404_3@

Text2.Text = ""@H_404_3@

Text3.Text = ""@H_404_3@

Picture1.FontSize = 12@H_404_3@

Picture1.FontBold = True@H_404_3@

Picture1.AutoRedraw = True@H_404_3@

drawvc@H_404_3@

End Sub@H_404_3@


Private Sub Command2_Click()@H_404_3@

Adodc1.RecordSource = "select * from useri where id='" & Text1.Text & "' and password='" & Text2.Text & "'"@H_404_3@

Adodc1.Refresh@H_404_3@

If Adodc1.Recordset.RecordCount > 0 And Text3.Text = vCode Then@H_404_3@

MsgBox ("登陆成功")@H_404_3@

ElseIf Text1.Text = "" Then

MsgBox ("用户名不能为空!"),vbOKOnly + vbInformation,"警告"


ElseIf Text2.Text = "" Then

MsgBox ("密码不能为空!"),"警告"


ElseIf Text3.Text = "" Then

MsgBox ("请输入验证码!"),"警告"
Else@H_404_3@

MsgBox ("您输入的密码或用户名错误"),"警告"@H_404_3@

End If@H_404_3@

End Sub@H_404_3@


Private Sub Command3_Click()@H_404_3@

End@H_404_3@

End Sub@H_404_3@

哪位高手帮我看看错在哪????@H_404_3@

急用!!!!!!!@H_404_3@

猜你在找的VB相关文章