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
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