哪个高手,能把这个C#给弄成VB.NET?下载图用
1,WebRequest和WebResponse
WebRequest request = WebRequest.Create("http://images.cnblogs.com/logo_small.gif");
WebResponse response = request.GetResponse();
Stream reader = response.GetResponseStream();
FileStream writer = new FileStream("x:\\pic.jpg", FileMode.OpenOrCreate, FileAccess.Write);
byte[] buff = new byte[512];
int c = 0; //实际读取的字节数
while ((c=reader.Read(buff, 0, buff.Length)) > 0)
{
writer.Write(buff, 0, c);
}
writer.Close();
writer.Dispose();
reader.Close();
reader.Dispose();
response.Close();
希望给改成VB.NET
[解决办法]
Stream可以直接转换成图片,没必要那这复杂