//HttpWebRequest 下载文件
private void DownloadFile(string filePath)
{
string[] temp = filePath.Split(new string[] { @"/" }, StringSplitOptions.None);
string fileName = temp[temp.Length - 1];
string PhysicalFilePath = Request.PhysicalApplicationPath + ConfigurationManager.AppSettings["UploadFilePath"];
if (!Directory.Exists(PhysicalFilePath))
Directory.CreateDirectory(PhysicalFilePath);
if (!System.IO.File.Exists(PhysicalFilePath + "\\" + fileName))
{
Uri downUri = new Uri(@"http://192.168.1.1" + filePath);
HttpWebRequest hwr = (HttpWebRequest)WebRequest.Create(downUri);
//设置接收对象的范围为0-10000000字节。
hwr.AddRange(0, 10000000);
using (Stream stream = hwr.GetResponse().GetResponseStream())
{
//文件流,流信息读到文件流中,读完关闭
using (FileStream fs = System.IO.File.Create(PhysicalFilePath + "\\" + fileName))