Italian Errore di lettura dopo download

corrado

Member
Licensed User
Longtime User
Ciao a tutti .
Ho un problema per leggere un file.txt scaricato.
Nell'istruzione: "Reader.New1(Response.GetStream,True)"
mi da questo errore:
formato della stringa di input non corretta.

Allego Sub

Sub DownloadFile (LocalFile,URL)
Response.New1
Request.New1(URL)
Response.Value = Request.GetResponse 'Launch the request and get the response.
Msgbox("Download size: " & Response.ContentLength) 'Show the file size.
Reader.New1(Response.GetStream,True) 'Use a BinaryFile object to read the data from the Response stream.
FileOpen(c1,LocalFile,cRandom)
Writer.New1(c1,False)
Dim buffer(4096) As byte
count = Reader.ReadBytes(buffer(),4096)
Do While count > 0
Writer.WriteBytes2(buffer(),0,count)
count = Reader.ReadBytes(buffer(),4096)
Loop
FileClose(c1)
Response.Close 'Close the Response stream.
Msgbox("File saved.")
End Sub

Ho allegato le librerie: HTTP, DOOR

Ciao a tutti

Corrado
 

maXim

Active Member
Licensed User
Longtime User
Ciao Corrado,

forse nel tuo progetto devi includere anche la libreria BinaryFile.dll, comunque in allegato trovi il tuo esempio leggermente modificato funzionante.

Saluti,

Massimo
 

Attachments

  • download.sbp
    1.3 KB · Views: 291

moster67

Expert
Licensed User
Longtime User
Bentornato maXim!

tutto ok?

ciao
moster67

Ciao Corrado,

forse nel tuo progetto devi includere anche la libreria BinaryFile.dll, comunque in allegato trovi il tuo esempio leggermente modificato funzionante.

Saluti,

Massimo
 

maXim

Active Member
Licensed User
Longtime User
Ciao moster67,

ebbene sì: sono tornato!
Tutto OK, solo il tempo necessario per rientrare in carburazione e per farmi venire qualche altra idea e quindi pubblicare qualcosa di nuovo... se ne avrò voglia!
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…