VB6代码转换VB.NET
DimiAsInteger,wdAsInteger,hdAsIntegerDimObjAsHTMLDocumentSetObj=WebBrowser1.Document....
Dim i As Integer, wd As Integer, hd As Integer
Dim Obj As HTMLDocument
Set Obj = WebBrowser1.Document.All.tags("iframe")(2).Document
For i = 0 To Obj.images.Length - 1
wd = Obj.images(i).Width
hd = Obj.images(i).Height
If wd = 800 Or wd = 790 Then
Call tupxiazai(Obj.images(i).href, App.path & "\image\" & i & "pic.jpg")
End If
Next
以上代码在VB6中可以实现,但是在VB.NET 中我不会使用请各位大神帮忙讲解一下在VB.NET中是怎么样的写法。研究了半天没研究出来。 展开
Dim Obj As HTMLDocument
Set Obj = WebBrowser1.Document.All.tags("iframe")(2).Document
For i = 0 To Obj.images.Length - 1
wd = Obj.images(i).Width
hd = Obj.images(i).Height
If wd = 800 Or wd = 790 Then
Call tupxiazai(Obj.images(i).href, App.path & "\image\" & i & "pic.jpg")
End If
Next
以上代码在VB6中可以实现,但是在VB.NET 中我不会使用请各位大神帮忙讲解一下在VB.NET中是怎么样的写法。研究了半天没研究出来。 展开
1个回答
展开全部
Dim i As Integer,wd As Integer,hd As Integer
Dim Obj As HtmlDocument=WebBrowser1.Document.GetElementsByTagName("iframe")(2).Document
For i=0 To Obj.Images.Count-1
wd=Obj.Images(i).OffsetRectangle.Width
hd=Obj.Images(i).OffsetRectangle.Height
If wd=800 Or wd=790 Then
Call tupxiazai(Obj.Images(i).GetAttribute("SRC"),Application.StartupPath & "\image\" & i & "pic.jpg")
End If
Next
Dim Obj As HtmlDocument=WebBrowser1.Document.GetElementsByTagName("iframe")(2).Document
For i=0 To Obj.Images.Count-1
wd=Obj.Images(i).OffsetRectangle.Width
hd=Obj.Images(i).OffsetRectangle.Height
If wd=800 Or wd=790 Then
Call tupxiazai(Obj.Images(i).GetAttribute("SRC"),Application.StartupPath & "\image\" & i & "pic.jpg")
End If
Next
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询