|
-
Aug 20th, 2004, 08:59 PM
#1
Thread Starter
Lively Member
checking file on internet
hey all,
wat im trying to do is get my program to check if the version it has is the newest.
my theory is - have 2 files, one the setup file the other a text file.
if the textfile name = the text in the curV.txt file then nuthing, otherwise download. can u please help me on this,
btw, the 2 files (setup.exe and textfile are on the net)
-
Aug 20th, 2004, 09:31 PM
#2
Hyperactive Member
What exactly are you having trouble with?
-
Aug 20th, 2004, 10:22 PM
#3
Thread Starter
Lively Member
i have no idea where to start?
-
Aug 21st, 2004, 12:38 AM
#4
Try this. You need a form with an Internet Transfer Control called inetDownload on it.
VB Code:
Option Explicit
Private Sub Form_Load()
DownLoadFromURL "http://www.yourwebsite.com/files/", "filetodownload.txt"
Unload Me
End Sub
Private Sub DownLoadFromURL(ByVal url As String, ByVal filename As String)
'
' Download a file from a given URL
'
Dim bytes() As Byte
Dim fnum As Integer
Dim ftext As String
'
' Download the file and load into byte array
'
ftext = url & filename
bytes() = inetDownload.OpenURL(ftext, icByteArray)
fnum = FreeFile
'
' Write the downloaded file to disk
'
Open App.Path & "\" & filename For Binary Access Write As #fnum
Put #fnum, , bytes()
Close #fnum
End Sub
This will download the file for you, what you do with the file is up to you.
Good luck
Pete
No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.
-
Aug 21st, 2004, 12:49 AM
#5
that inspires me to write an app for my dad. his golf club posts a new handicap file every week to be used by an app that they gave him. i have to go over there every week to get it for him. if i can teach him to run this app while he's online, then it'll get the new file without my help. brillant!
-
Aug 21st, 2004, 02:45 AM
#6
Thread Starter
Lively Member
-
Aug 21st, 2004, 02:56 AM
#7
Thread Starter
Lively Member
-
Aug 22nd, 2004, 02:55 AM
#8
Jeez!! You've made me blush
By the way, you're welcome.
Pete
No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|