2008-11-02 4 views

Répondre

5
System.Net.WebClient webClient = new WebClient(); 

webClient.DownloadFile(@"http://stackoverflow.com/Content/Img/stackoverflow-logo-250.png", 
@"c:\path\localfile.png"); 

Vous pouvez utiliser Server.MapPath pour obtenir un répertoire physique sur le serveur correspondant au chemin relatif ou virtuel, par exemple Server.MapPath("~/Images")

+0

Puis-je vous demander pourquoi vous mettez @ au début de l'URL et nom de fichier? – leen3o

+0

@ leen30 pour échapper \ caractères –

Questions connexes