给你一段我收藏的代码,你自己改改
Private Sub Form_Load()
wbr.Navigate "http://warlord.
'wbr为在‘工程’---‘部件’中添加microsoft internet control,然后拖一个webbrowser至窗体,改名wbr
End Sub
Private Sub wbr_DocumentComplete(ByVal pDisp As Object, URL As Variant)
'你可以运行,观看效果,是不是自动把你设置的值给填进去了
Dim obj
If Not (pDisp Is wbr.Object) Then
Exit Sub
End If
For Each obj In wbr.Document.All
If TypeName(obj) = "HTMLInputElement" Then
If obj.Name = "username" Then
obj.Value = "myname"
End If
If obj.Name = "passwd" Then
obj.Value = "123456"
Exit For
End If
End If
Next
End Sub