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
相关文档:
工作需要,针对java文件,作了一个行数统计的工具。统计的主要代码如下:
Set srcIn = fso.OpenTextFile(fileNm, ForReading)
Do While Not srcIn.AtEndOfStream
buf = srcIn.ReadLine
&nbs ......
http://blog.donews.com/sloo/archive/2006/01/29/711269.aspx
1.用Microsoft Internet Transfer Control 控件(在部件中添加),代码非常简单,如下(在form上添加一个Inet1和Text1和Command1):
Private Sub Command1_Click()
Text1.Text = Inet1.OpenURL("http://www.vbgood.com/")
End Sub
2.如果是使用 W ......
Option Explicit
Private Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As Long, ByVal bRevert As Long) As Long
Private Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, Optional ByVal wFlags As Long = 0&) As Long
Private Declare Function DrawMenu ......
VB编写托盘图标有两个要点,一是使用 Shell_NotifyIcon 函数显示图标;二是向系统注册 TaskbarCreated 消息,以便explorer崩溃时恢复托盘的图标。
首先需要增加一个模块文件,内容如下:
Public Declare Function Shell_NotifyIcon Lib "shell32.dll" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, lpData As NOT ......
VB学的用的都不精,编个程序用了很长时间了,现在这个通讯部分还没做好,求助大家一下:
ctrMSComm.Output = "@01R" '读命令
instar = ctrMSComm.Input '读通讯
wy_I = val(HEX_to_DEC(Mid(instar, 29, 4))) * (20 / 4095#)
&n ......