vb实现网页自动填表
http://tieba.baidu.com/f?kz=580219489
http://www.anqn.com/vb/154/8974.shtml
http://www.codefans.net/soft/5089.shtml
http://www.mndsoft.com/blog/article.asp?id=1121
http://topic.csdn.net/t/20020113/14/474848.html
直接运行网页中的JavaScript:
function alllefttab()
WebBrowser1.Document.parentwindow.execScript "insert(2)", "JavaScript"
自动选择下拉列表中的某项2
Dim s
s = "javascript:document.getElementsByName(""w_type"")[0].value='2';void(0)"
WebBrowser1.Document.parentwindow.execscript s
添加一个WebBrowser1
Private Sub Form_Load()
WebBrowser1.Navigate "http://zhidao.stnts.com/"
'WebBrowser1.Navigate "http://zhidao.stnts.com/index.php?act=worklog:loginfo&id="
End Sub
Private Sub Form_Resize()
WebBrowser1.Width = Me.Width - 600
WebBrowser1.Height = Me.Height - 1000
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
'登录并转到
If WebBrowser1.LocationURL = "http://zhidao.stnts.com/" Then
Dim vDoc, vTag
Dim i As Integer
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" Or vTag.Type = "password" Then
Select Case vTag.Name
Case "userid"
vTag.Value = "这里是用户"
Case "userps"
vTag.Value = "这里是密码"
End Select
ElseIf vTag.Type = "submit" Then
vTag.Click
End If
End If
Next i
WebBrowser1.Navigate "http://zhidao.stnts.com/index.php?act=worklog:insert"
End If
If WebBrowser1.LocationURL = "http://zhidao.stnts.com/index.php?act=worklo
相关文档:
——————————————————————————————————
在c#中如何使用以前c++的.lib库和.h头文件
zhujiang_1977(朱江 ......
VB 字符串处理函数集
收藏
mid(字符串,从第几个开始,长度)
在[字符串]中[从第几个开始]取出[长度个字符串]
例如 mid("小欣无敌",1,3) 则返回 "小欣无"
instr(从第几个开始,字符串1,字符串2)
从规定的位置开始查找 ......
VB编写托盘图标有两个要点,一是使用 Shell_NotifyIcon 函数显示图标;二是向系统注册 TaskbarCreated 消息,以便explorer崩溃时恢复托盘的图标。
首先需要增加一个模块文件,内容如下:
Public Declare Function Shell_NotifyIcon Lib "shell32.dll" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, lpData As NOT ......