0

Hello!

Can someone tell me how can i do following...

I would like to load a file from www and save it to folder. I am using Visual studio 2008 an VB in form aplication.
So how to load a file from example www.test.gg and saving it to c:/myfolder/


THX

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by __avd
0

ufff..... i am not gettin' it.... can you be more specific?

0

>ufff..... i am not gettin' it.... can you be more specific?

Dim request As HttpWebRequest = CType(WebRequest.Create("url"), HttpWebRequest)

 request.MaximumAutomaticRedirections = 4
 
 request.MaximumResponseHeadersLength = 4

 request.Credentials = CredentialCache.DefaultCredentials
 
 Dim response As HttpWebResponse = CType(request.GetResponse(),  HttpWebResponse)

 ' Get the stream associated with the response.
 Dim receiveStream As Stream = response.GetResponseStream()

 Dim readStream As New StreamReader(receiveStream, Encoding.UTF8)
 
 Console.WriteLine(readStream.ReadToEnd())
 
 response.Close()
 
 readStream.Close()

...

Try to implement and if you run into problems and want to ask for help here.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.