Hello, I would like to know how to connect to a site and read a data file and have a textbox have the same text as the file. The reason so I can learn an easy way to check for updates.
Printable View
Hello, I would like to know how to connect to a site and read a data file and have a textbox have the same text as the file. The reason so I can learn an easy way to check for updates.
Use the Internet Transfer Control (Inet):
edit: For a better view, use:VB Code:
Text1.Text = Inet1.OpenURL ("http://www.google.com")
VB Code:
Text1.MultiLine = True
i would download a spicified INI or TXT file and have the newest version stored in there, and compare it to the version stored in the your exe.
Is there another way to do this besides the Internet Transfer Control?
You could FTP the file. How you do it depends on how the site is set up and what permissions you have on the site.
Nevermind I used something I found in the API-Guide. If you are interested it was this:
VB Code:
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean Dim lngRetVal As Long lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0) If lngRetVal = 0 Then DownloadFile = True End Function Private Sub Form_Load() 'example by Matthew Gates ([email protected]) DownloadFile "http://www.allapi.net", "c:\allapi.htm" End Sub
I have just recently see somebody having problems with this API. Check... this thread.
Thanks, I will look into it