 悬赏园豆:10
                [已关闭问题] 
            
                    关闭于 2011-04-24 13:05
                悬赏园豆:10
                [已关闭问题] 
            
                    关闭于 2011-04-24 13:05
                 
        代码如下:
WebClient client = new WebClient();
Stream stream = client.OpenRead("http://www.vchome.net/dotnet/dotnetdocs/dotnet37.htm");
FileStream fs = File.Open("a.html", FileMode.Create);
using (fs)
{
using (stream)
{
while (true)
{
byte[] b = new byte[100];
int r = stream.Read(b, 0, b.Length);
fs.Write(b, 0, r);
if (r < b.Length)
{
break;
}
}
}
}
Console.WriteLine("ok");
上面的代码只能下载一部分,不能全部下载,为什么?
在线等。。。。。