读书人

请问 用VB制作网站登陆器 的有关问题

发布时间: 2012-01-07 21:41:55 作者: rapoo

请教 用VB制作网站登陆器 的问题。
用VB制作网站登陆器怎么不行?
代码:

Private Sub Command1_Click()
If Text1.Text = "" Then MsgBox "用户名不能为空": Exit Sub
If Text2.Text = "" Then MsgBox "密码不能为空": Exit Sub
Dim strFormData As String
strFormData = "uid=" + Text1.Text + "&pwd=" + Text2.Text
Inet1.Execute "http://www.jcard.cn/ReLogin.aspx", "Post", strFormData, "Content-Type: application/x-www-form-urlencoded"
Do Until Inet1.StillExecuting = False
DoEvents
Loop
WebBrowser1.Navigate "http://www.jcard.cn/ReLogin.aspx"
End Sub

其中Inet1.Execute 行错误。

[解决办法]
http://www.is21.cn/article.asp?id=251 自动网易登陆
[解决办法]
用记事本保存为一个扩展名为:vbs的文件
然后双击执行
验证码自己想办法吧

dim ie
set ie=createobject("InternetExplorer.application")
ie.navigate "http://www.jcard.cn/ReLogin.aspx"
ie.visible=true
do while ie.busy
wscript.sleep 1000
loop
ie.document.getElementById("ctl00_Login1_txtAccount").value="asdfasdfasdfasdf2@sohu.com"

ie.document.getElementById("ctl00_Login1_txtPassword").value="asdfasdfasdfasdf2@sohu.com"
ie.document.getElementById("ctl00_Login1_txtExtCode").value="asdfasdfasdfasdf2@sohu.com"
ie.document.parentWindow.execScript ("onEnterPress(13)")



[解决办法]
Private Sub Command1_Click()
Wb1.Navigate "http://warlord.duowan.com/f1.html"
'连接到网站
End Sub

Private Sub WB1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Dim vDoc, vTag
Dim i As Integer
Set vDoc = Wb1.Document
List1.Clear
For i = 0 To vDoc.All.length - 1
If UCase(vDoc.All(i).tagName) = "INPUT" Then ' 查找Object属性为Input的可输入项
Set vTag = vDoc.All(i)
List1.AddItem vDoc.All(i).tagName
If vTag.Type = "text" Or vTag.Type = "password" Then
Select Case vTag.Name
Case "username" '如果是用户名的那个框
vTag.Value = "xxxxxxx" '这个是用户名
Case "passwd"
vTag.Value = "xxxxxxxxx" '这个是密码
Case "sessioncode"
vTag.Value = "xxxx" '这个是验证码
End Select
With vDoc.All(i)
If UCase$(.tagName) = "INPUT" Then ' 查找Object属性为Input的可输入项
'如是,则判断其是否是制定图片链接,并可点击
If UCase$(.Type) = "IMAGE" And .src = "http://warlord.duowan.com/f1.html#" Then
.Select '模拟选择图片
.Click '模拟鼠标单击
End If
End If
End With
End If
End If
Next i
End Sub

这是我在网上找的,经过整理,验证过。
我现在也在做这方面事。
现阶段在最难得就是验证码!

读书人网 >VB

热点推荐