C#下载网页中的文件//获取页面内容可以用 System.Net.WebRequest myRequest = System.Net.WebRequest.Create("http://www.163.com"); //利用WebClient来下载网页中的文件 System.Net.WebClient wc = new System.Net.WebClient(); //无返回值按照指定物理目录存储 wc.DownloadFile("HTTP://www.163.com",@"C:\demo.txt"); //转成字节数组存入数据库中 byte[] bytesFile = wc.DownloadData("HTTP://www.163.com"); 转载于:https://www.cnblogs.com/hanguoji/archive/2007/05/30/765169.html