VB自动登陆网络站点详解(二):Inet控件与WebBrowser控件配合使用[3]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 lvlvlvlylyly 的 blog

if me.windowstate <> 1 then

    webbrowser1.left = 10

    webbrowser1.width = me.width - 120

    webbrowser1.height = me.height - 800

end if

end sub

private sub text2_keyup(keycode as integer, shift as integer)

    if keycode <> 13 then exit sub

    if combo1.listindex = 3 then msgbox "请选择一个登陆": exit sub

    if text1.text = "" then msgbox "请输入用户名": exit sub

    if text2.text = "" then msgbox "请输入密码": exit sub

    dim strformdata as string

    strformdata = c1(combo1.listindex) + "=" + text1.text + "&" + c2(combo1.listindex) + "=" + text2.text + "&" + c3(combo1.listindex)

    inet1.execute url1(combo1.listindex), "post", strformdata, "content-type: application/x-www-form-urlencoded "

    do until inet1.stillexecuting = false '这里阻塞前面的inet1,确保登陆成功之后再取页面,你可以将此do取消了试一次。

本文关键:自动登陆
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top