2008-11-02 37 views

回答

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

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

您可以使用Server.MapPath獲得對應的相對或虛擬路徑上的服務器上的物理目錄,例如Server.MapPath("~/Images")

+0

我可以問你爲什麼把@在URL文件名的開始? – leen3o 2009-04-21 13:53:07