| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 600 人关注过本帖
标题:求助:VB写登录PW论坛问题
取消只看楼主 加入收藏
统一电讯
Rank: 2
等 级:论坛游民
帖 子:18
专家分:10
注 册:2009-3-2
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:1 
求助:VB写登录PW论坛问题
Dim flag As Boolean

Private Sub Command1_Click()
Dim vDoc, vTag
Dim i As Integer
If flag = False Then
MsgBox "请稍等。。。"
Exit Sub
End If
Set vDoc = WB.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 "pwuser"
vTag.Value = Text1.Text
Case "pwpwd"
vTag.Value = Text2.Text
End Select
End If
End If
If UCase(vDoc.All(i).tagName) = "BUTTON" Then
Set vTag = vDoc.All(i)
If vTag.Type = "submit" Then
vTag.Click
End If
End If
Next i

End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Form_Load()
Dim URL As String
On Error Resume Next
URL = "http://www.
WB.Navigate URL
flag = False
End Sub

Private Sub wb_DownloadComplete()
flag = True
End Sub
上面的代码当点击了登录按钮之后只能填表不能登录并跳转页面
登录PW论坛.rar (2.26 KB)
搜索更多相关主题的帖子: 登录 
2010-04-23 14:34
统一电讯
Rank: 2
等 级:论坛游民
帖 子:18
专家分:10
注 册:2009-3-2
收藏
得分:0 
已经解决提交按钮应该是"INPUT"
Dim flag As Boolean

Private Sub Command1_Click()
Dim vDoc, vTag
Dim i As Integer
If flag = False Then
MsgBox "请稍等。。。"
Exit Sub
End If
Set vDoc = WB.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 "pwuser"
vTag.Value = Text1.Text
Case "pwpwd"
vTag.Value = Text2.Text
End Select
End If
End If
If UCase(vDoc.All(i).tagName) = "INPUT" Then
Set vTag = vDoc.All(i)
If vTag.Type = "submit" Then
vTag.Click
End If
End If
Next i

End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Form_Load()
Dim URL As String
On Error Resume Next
URL = "http://www.
WB.Navigate URL
flag = False
End Sub

Private Sub wb_DownloadComplete()
flag = True
End Sub
这样就可以登录了
2010-04-23 17:09
快速回复:求助:VB写登录PW论坛问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.022771 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved