vb方法能转化为vb.net方法吗?
必须引用Microsoft html object library
单击command1获得框架及其元素方法1
Private Sub Command1_Click()
Dim Doc2 As HTMLDocument
Dim Web2 As WebBrowser_V1
Set Web2 = GetFrameIframeLikeUrl(WebBrowser1.Document, "*baidu.com*")
If Not Web2 Is Nothing Then
Set Doc2 = Web2.Document
Doc2.getElementById("JZGXXJLXX_addBtn").Click,单击了网页框架中的按钮
End If
End Sub
Function GetFrameIframeLikeUrl(Vdoc As HTMLDocument, LikeUrl As String) As WebBrowser_V1
Dim Vtag, Tname As String, FrameWeb As WebBrowser_V1
For Each Vtag In Vdoc.All
Tname = Vtag.tagName
If Tname = "IFRAME" Or Tname = "FRAME" Then
Set FrameWeb = Vtag
If FrameWeb.LocationURL Like LikeUrl Then
Set GetFrameIframeLikeUrl = FrameWeb
Exit Function
End If
End If
Next
End Function
不知在中怎么实现。上述代码能转化为代码吗?期待高手。