以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  求助:话说 怎么实现当代码A运行后 再自动运行代码B呢?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=84959)

--  作者:李孝春
--  发布时间:2016/5/13 19:51:00
--  求助:话说 怎么实现当代码A运行后 再自动运行代码B呢?
话说 怎么实现当代码A运行后 再自动运行代码B呢?

图片点击可在新窗口打开查看此主题相关图片如下:qq图片20160513194944.png
图片点击可在新窗口打开查看

Dim web As System.Windows.Forms.WebBrowser = e.Form.Controls("WebBrowser1").Basecontrol
web.Navigate("https://mp.weixin.qq.com")
Do Until web.ReadyState = 4
    Application.DoEvents
Loop

If web.Document.Body.OuterHtml.Contains("btn_login") Then \'判断一下当前页面的是否包含这串字符串(用来判断是否已经处于登录状态)
    web.Document.GetElementById("account").SetAttribute("Value", "wax")
    web.Document.GetElementById("Password").SetAttribute("Value", "0854")
    web.Document.GetElementById("loginbt").InvokeMember("click")
Else
    If web.Document.Body.OuterHtml.Contains("logout") Then \'判断一下当前页面的是否包含这串字符串(用来判断是否已经处于登录状态)
        web.Navigate("https://mp.weixin.qq.com/cgi-bin/appmsg?begin=0&count=10&t=media/appmsg_list2&type=10&action=list_list&token=1020867542&lang=zh_CN")
    End If
End If

--  作者:Hyphen
--  发布时间:2016/5/14 10:49:00
--  
if 条件 then
    代码A
end if

代码B

--  作者:qianqian1530
--  发布时间:2016/5/14 10:55:00
--  
或者是,   把A 和B  分别 写成 内部函数.     想执行的时候 直接用 就行.