开发者

How can i calculate height of a website?

开发者 https://www.devze.com 2022-12-11 16:02 出处:网络
I want to take a snapshot of a website so i have to calculate height of a w开发者_StackOverflow社区ebsite. I want to use this value in:

I want to take a snapshot of a website so i have to calculate height of a w开发者_StackOverflow社区ebsite. I want to use this value in:

Dim MyBrowser As New WebBrowser
MyBrowser.Size = New Size(1027, ???)

Thanks...


Try the following.

Dim docWidth as Integer 
Dim docHeight as Integer

docHeight = WebBrowser1.Document.Body.ScrollRectangle.Height
docWidth = WebBrowser1.Document.Body.ScrollRectangle.Width


when you said height of a website.. did you mean height of a browser window or the the whole document ?

By height of a website if you meant any of the above, you can take a look into this and get the value of height( browser/document) and send that back to server.

0

精彩评论

暂无评论...
验证码 换一张
取 消