我正在使用VB.NET制作投票宏。除了单击按钮外,我一切正常。
按钮代码:
<input type="button" value="Vote: Runelocus" onclick="window.open('http://www.runelocus.com/toplist/index.php?action=vote&id=277&id2=333119125058'); setStatus(1);">
每次单击此按钮时,我都会得到一个system._comobject
.
这是我用来获取地址的代码
Try
Dim ele As HtmlElement = WebBrowser1.Document.ActiveElement
Dim target As String = ele.GetAttribute("onclick")
target = target.Replace("'); setStatus(1);", String.Empty)
target = target.Replace("window.open('", String.Empty)
e.Cancel = True
Dim window As New Voter()
window.Show()
window.WebBrowser1.Navigate(target)
status.Items.Add(target)
Catch ex As Exception
MsgBox(ex.Message.ToString)
End Try