• 主页
  • VBS
  • .NET技术
  • VBA
  • VB网络编程
  • VB多媒体
  • VB数据库
  • VB控件
  • VB COM/DCOM
  • VB基础类
  • VB API

看看这段代码怎么翻译成vb.net

asq985 2009-05-11 04:26:37

private void webBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e)
{
IHTMLDocument2 vDocument = (IHTMLDocument2)webBrowser1.Document.DomDocument;
foreach (IHTMLElement vElement in vDocument.all)
{
if (vElement.tagName.ToUpper() == "FRAME")
{
IHTMLFrameBase2 vFrameBase2 = vElement as IHTMLFrameBase2;
vFrameBase2.contentWindow.execScript(
"function alert(str){confirm('[' + str + ']');}", "javaScript");
}
}
}

...全文
12 点赞 收藏 2
写回复
2 条回复
kzccomputer 2009年05月11日
Private Sub webBrowser1_Navigated(sender As Object, e As WebBrowserNavigatedEventArgs)
Dim vDocument As IHTMLDocument2 = DirectCast(webBrowser1.Document.DomDocument, IHTMLDocument2)
For Each vElement As IHTMLElement In vDocument.all
If vElement.tagName.ToUpper() = "FRAME" Then
Dim vFrameBase2 As IHTMLFrameBase2 = TryCast(vElement, IHTMLFrameBase2)
vFrameBase2.contentWindow.execScript("function alert(str){confirm('[' + str + ']');}", "javaScript")
End If
Next
End Sub
回复 点赞
vlsm 2009年05月11日

Private Sub webBrowser1_Navigated(ByVal sender As Object, ByVal e As WebBrowserNavigatedEventArgs)
Dim vDocument As IHTMLDocument2 = DirectCast(webBrowser1.Document.DomDocument, IHTMLDocument2)
For Each vElement As IHTMLElement In vDocument.all
If vElement.tagName.ToUpper() = "FRAME" Then
Dim vFrameBase2 As IHTMLFrameBase2 = TryCast(vElement, IHTMLFrameBase2)
vFrameBase2.contentWindow.execScript("function alert(str){confirm('[' + str + ']');}", "javaScript")
End If
Next
End Sub
回复 点赞
发动态
发帖子
VB
创建于2007-09-28

1.1w+

社区成员

11.0w+

社区内容

VB技术相关讨论,主要为经典vb,即VB6.0
社区公告
暂无公告