问题1:
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", "waxjcy")
web.Document.GetElementById("Password").SetAttribute("Value", "08542622000")
web.Document.GetElementById("loginbt").InvokeMember("click")
End If
Dim div = web.Document.GetElementById("menuBar")
Do While div Is Nothing
div = web.Document.GetElementById("menuBar")
Application.DoEvents
Loop
Dim hec As System.Windows.Forms.HtmlElementCollection = div.GetElementsByTagName("A")
For i As Integer = 0 To hec.Count-1
If hec(i).InnerHtml.Contains("素材管理") Then
hec(i).InvokeMember("click")
Exit For
End If
Next