为什么下载的zip文件里面文件比服务器少
下载的zip文件跟服务器上的个数不一样啊string a = "";
HttpWebRequest myReq = null; HttpWebResponse HttpWResp = null;
try
{
myReq = (HttpWebRequest)HttpWebRequest.Create("http://xxx.xxx.xxx.xx/Images/MomanCamera/background/MomanCamera_background_icons__1000001.zip");
myReq.Timeout = 5000;
HttpWResp = (HttpWebResponse)myReq.GetResponse();
HttpStatusCode httpCode = HttpWResp.StatusCode;
long fileSize = 0;
if (httpCode == HttpStatusCode.OK)
{
Stream myStream = HttpWResp.GetResponseStream();
fileSize = HttpWResp.ContentLength;
byte[] b = new byte[fileSize];
myStream.Read(b, 0, b.Length);
if (b != null)
{
FileStream fs;
FileInfo fi = new FileInfo(@"d:\1.zip");
fs = fi.OpenWrite();
fs.Write(b, 0, b.Length);
fs.Close();
}
}
}
catch (Exception ex)
{
}
finally
{
if (myReq != null)
myReq = null;
if (HttpWResp != null)
{
HttpWResp.Close();
HttpWResp = null;
}
} --------------------编程问答-------------------- 大神求解啊
补充:.NET技术 , ASP.NET