2008-11-02 66 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