|
-
April 26th, 2001, 03:11 AM
#1
I want to download different images from internet, when clicking on a commandbutton the image must c
I have made a program, its the intention that when started up the program automatically downloads a database file (a .dat / .txt format) and reads the data from the file (which contains more records) download files which are in the records and displays them (text and image or video).
text works fine but the others really dont.
Because a picture or a image control cant change i use a html document (every time the files are downloaded to exactly the same name, so that the html only needs to refresh).
But sometimes it works and sometimes it doesnt.
I'll include the entire module and a example of the database...
The module which downloads data and processis it:
tekstpath = App.Path & "\" & "temp.txt"
configfile = App.Path & "\config.dat"
Open configfile for input as #1
on error resume next
input #1, snelheid_bestand, sexkeuze_bestand
Close #1
' If snelheid_bestand Or sexkeuze_bestand = "" then GoTo hetbegin
If sexkeuze_bestand = "hetro" then db = "hetro.dat"
If sexkeuze_bestand = "trio" then db = "trio.dat"
If sexkeuze_bestand = "lesbie" then db = "lesbie.dat"
If sexkeuze_bestand = "homo" then db = "homo.dat"
If sexkeuze_bestand = "bi" then db = "bi.dat"
If sexkeuze_bestand = "beroep" then db = "beroep.dat"
hoofddb = App.Path & "\" & db
on error resume next
Kill ("c:\filmpje.jpg")
Kill ("c:\plaatje.jpg")
Kill (tekstpath)
Kill (hoofddb)
nummer = Label1.Caption
nummer = nummer + 1
configfile = App.Path & "\config.dat"
filmpjehtm = App.Path & "\filmpje.htm"
plaatjehtm = App.Path & "\plaatje.htm"
Open configfile for input as #1
on error resume next
input #1, snelheid_bestand, sexkeuze_bestand
Close #1
If sexkeuze_bestand = "hetro" then db = "hetro.dat"
If sexkeuze_bestand = "trio" then db = "trio.dat"
If sexkeuze_bestand = "lesbie" then db = "lesbie.dat"
If sexkeuze_bestand = "homo" then db = "homo.dat"
If sexkeuze_bestand = "bi" then db = "bi.dat"
If sexkeuze_bestand = "beroep" then db = "beroep.dat"
hoofddb = "http://www.infoplace.nl/db/" & db
plaats = App.Path & "\" & db
Call URLDownloadToFile(0, hoofddb, _
plaats, 0, 0)
Do
Open plaats for input as #1
input #1, klantnummer, Text, foto, video
nummer1 = nummer1 + 1
Loop Until nummer = nummer1
Close #1
tekstpath = App.Path & "\" & "temp.txt"
Call URLDownloadToFile(0, Text, tekstpath, 0, 0)
Open tekstpath for input as #1
input #1, tekst_input
Close #1
Text1.Text = tekst_input
Text1.Visible = true
If Not foto = "geen" then
plaatjepath = "c:\plaatje.jpg"
Call URLDownloadToFile(0, foto, plaatjepath, 0, 0)
'zichtbaar worden ???
WebBrowser2.Navigate (plaatjehtm)
WebBrowser2.Refresh
End If
If Not video = "geen" then
vidpath = "c:\filmpje.avi"
Call URLDownloadToFile(0, filmpje, vidpath, 0, 0)
WebBrowser2.Navigate (filmpjehtm)
WebBrowser2.Refresh
End If
Command1.Visible = false
Command2.Visible = true
Command3.Visible = true
Command4.Visible = true
Label1.Caption = klantnummer
End Sub
That was the code of the module (command2.click), so that module only works when there allready is one downloaded file (main database and files) and you click on the commandbutton.
Next is a sample of the 'main' database file :
"01","http://www.infoplace.nl/text/01.txt","http://www.infoplace.nl/plaatjes/sebastian.jpg","geen"
"02","http://www.infoplace.nl/text/02.txt","http://www.infoplace.nl/plaatjes/pim.jpg","geen"
"04","http://www.infoplace.nl/text/04.txt","http://www.infoplace.nl/plaatjes/sebastian.jpg","geen"
The first number is the number in the database (very important later), then ther is a url with a text file (the perfectly working text system) and then there are urls for images and video, those two have a special thingy, if it countains 'geen' there will not be displayed that...
I hope you can help me with getting this module to work.
I have tried to make it work for over 2 days now, but everytime i think it finally works it crashes again or something.
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
|