Download file from Server within C#
Scaricare un file da un Server con C#
Di seguito uno snippet per effettuare il download di un file da un Server mediante C#.
L’esempio comprende il caso in cui il Server richiede l’autenticazione mediante credenziali ed utilizza la classe WebClient del namespace System.Net.
WebClient client = new WebClient(); client.Credentials = new NetworkCredential("username", "password", "domain"); client.DownloadFile(@"http://url_server/nomefile.zip", @"C:\File.zip");
Enjoy snippet!
Lascia un commento