AuthorMessage
C0D3Z3R0
Pro
Posts: 166

Does anyone know how I can download a text file or open a text file from the web in visual basic? I'm wanting to do this so that my program can check for an update using the text file that will have the version number in it and if the version is higher than the programs version then it will display a message saying an update is available and offer the user to download an updated version of the program...
b_w_johan
Regular
Posts: 56

create small server-client protocol...
on startup program tcp connect to youre server
C= client
S= Server
C) login to server
S) Identify
C) v:0.0.0
S)
well on youre choise send
OK
OLD
if sended old to the client
let it popup some message
if you really like to use that read from file do same thing but instead of sending ok/old
let it send a new version number you compare to ini (ini = simplest way of creating a file as far as i know now hehe)
don't know if its gonna help but i would do something like this i guess....
b_w_johan
--edit
can't you use the webbrowser omponent
and not use .txt but .html instead of youre comparing thingy ??
C0D3Z3R0
Pro
Posts: 166

I would use the web browser component but I don't know how I could read what is on it.. maybe you could show me a small example or something?
For the server... It would mean leaving my comp on 24/7 and would waste bandwidth with it having to connect to me all the time where if it's on a website they're normally online all the time and have fast connections to the net..
Meka][Meka
Unstopable
Posts: 700

alredy showed u something similar in vb7...cy.
C0D3Z3R0
Pro
Posts: 166

Yeah, I need it in vb6 though
dzadzuks
Ametuar
Posts: 135

hmz... well i see that nobody wants to write this thing. so i wrote one quick with MS Internet Transfer component,
here goes dzadzu code:
Code:
Private Sub Command1_Click()
 Inet1.URL = Text1.Text    'here we see thet Text1 is URL..
 Inet1.Execute    'Inet is Microsoft Internet Transfer component
End Sub
Private Sub Inet1_StateChanged(ByVal State As Integer)
Dim Crap As String
On Error Resume Next    'here was som little error.. donno why.. but its ok.. works fine anyway
Do
     Crap = Inet1.GetChunk(2000)  'we get the chunk..
     DoEvents
     Text3.SelText = Text3.SelText & Crap 'store it in Text3
     DoEvents
     Loop While Len(Crap) > 0  'Loop till there is nothing more left..
End Sub

/dzadzuks