Hello!
How do i retrieve a webpage-sourcecode from with a classmodule without using a hidden form?
I think it's difficult to place a component in a class - can it be done some other weay??
Kind regards
Janus
Printable View
Hello!
How do i retrieve a webpage-sourcecode from with a classmodule without using a hidden form?
I think it's difficult to place a component in a class - can it be done some other weay??
Kind regards
Janus
Code:'using the inet control grab the source code of a web page
Private Sub Command1_Click()
Dim myFile As String
myFile = "C:\my documents\myfile.txt"
Dim myString As String
'surf to the webpage and read it's content into myString
Open myFile For Output As #1
myString = Inet1.OpenURL("http://www10.ewebcity.com/dirtbagdog/main.htm", icString)
ReturnStr = Inet1.GetChunk(2048, icString)
Do While Len(ReturnStr) <> 0
DoEvents
myString = myString & ReturnStr
ReturnStr = Inet1.GetChunk(2048, icString)
Loop
'save the content of the webpage source to "C:\my documents\myfile.txt"
Write #1, myString
Close #1
End Sub
I found that there is a very good API function for downloading a file from internet from krigans
. http://forums.vb-world.net/showthrea...threadid=41471
Juz take a look on it, and may be you can try it out too. :)