|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to load webpage in VB6?
I would like to open a webpage (text files) in Visual Basic 6, and store the results in an array. I don't want the user to see the webpage opening up, like running shell explorer or shell start. I found quite a few examples online, but none of them worked. In Perl, this is all the I would have to do:
PHP Code:
I am an Unix (C, Perl, Shells, etc) programmer, and this is one of my first attempts at Windows programming. So, please be kind and help me out. Thank you |
|
#2
|
|||
|
|||
|
Search the msdn library for info on the webbrowser control.
|
|
#3
|
|||
|
|||
|
Doug,
Reading the MSDN library is very difficult, and not productive from a newbie point of view. Is there an example that I could look at? Thank you |
|
#4
|
|||
|
|||
|
I successfully created a WebBrowser1 control. I still have a few question through. Can I not view the URL? I made the height and width both set to 0, but that results with a dot on the screen.
Also, how do I parse the URL data? |
|
#5
|
|||
|
|||
|
Use the visible property to hide the control
WebBrowser1.Visible = false To get the URL use MyString = WebBrowser1.LocationURL You normally will use the Navigate or Navigate2 method to open a URL with the control, and then wait for the DocumentComplete event. After the DocumentComplete event, you can get the page source using strHTML = WebBrowser1.Document.InnerHTML |
|
#6
|
|||
|
|||
|
Doug,
For some reason, when I hide the control, the webpage does not appears to be opening at all. WebBrowser1.Visible = false Here is my code: PHP Code:
PHP Code:
Any ideas? My next question, is how do I parse data out of the strHTML String? The string is delimited with a couple of EOLN. Is there a split function in Visual Baic like Perl? Thank you again |
|
#7
|
|||
|
|||
|
Yes, VB has a split function. This link will take you to the top of the VB6 refrence documentation for the VB functions, objects, and VB-distributed controls.
http://msdn.microsoft.com/library/e...cLROverview.asp About not opening the web page, perhaps the webbrowser control is inactive if not visible? I've never tried using it while not visible. There is also an Internet Transfer control that may work for you, for the documentation on that control look in the controls section of the reference documentation from the above link. Oh, try using the Navigate2 method. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > How to load webpage in VB6? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|