c# - Download and save file from http server using .Net Socket -


hello everybody.

i know how download , save file hard drive, zip file http server using system.net.socket.sockets class.

i know there allot easier ways download file .net, know how with sockets, if possible of course although i'm pretty sure is.

i've tried few things, nothing worked once don't have background experience sockets.

your satisfying curiosity appreciated. question ask. thank you.

note:

  • the file standard zip file, way work file type.
  • the file size different every day.
  • the file downloaded every minute, caching of such file must disabled accurate , update file version server.
  • file url sample: www.somewhere.com/files/feed/list.zip

you directly .net socket, require parsing , understanding http request.

the standard way use higher level system.net classes. example, can done in 2 lines of code via webclient.downloadfile - why make life more difficult yourself?


if must raw sockets, take lot of work. @ it's core, can connect port 80 (assuming http) via tcp connection, write correct strings socket, , start receiving data.

that being said, getting correct, , handling of issues required far beyond standard stackoverflow answer's scope. if want go down road, take @ http protocol specifications - you'll need implement proper aspects of specification.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -