VB代码,编写以下地址登陆,代码怎么写?

来源:百度知道 编辑:UC知道 时间:2024/06/15 02:17:00
就像登陆器那样
这是地址:http://www.255gm.cn/logging.php?action=login
可以像截图那样效果

Private Sub Command1_Click()
Set vdoc = WebBrowser1.Document
For I = 0 To vdoc.All.length - 1
If UCase(vdoc.All(I).tagName) = "INPUT" Then
Set vtag = vdoc.All(I)
If vtag.Type = "text" Then
If vtag.Name = "username" Then vtag.Value = Text1.Text
ElseIf vtag.Type = "password" Then
vtag.Value = Text2.Text
End If
End If
Next I
For I = 0 To vdoc.All.length - 1
If LCase(vdoc.All(I).tagName) = "button" Then
Set vtag = vdoc.All(I)
If vtag.Type = "submit" And vtag.Name = "loginsubmit" Then '提交按钮
vtag.Click
Exit For
End If
End If
Next I
End Sub

Private Sub Form_Load()
WebBrowser1.Navigate "http://www.255gm.cn/logging.php?action=login"
End Sub