漂亮的图像:D
尝试使用以下代码:
您需要使用BinaryReader,因为图像文件是二进制数据,因此未以UTF或ASCII编码
编辑:using’ified
HttpWebRequest lxRequest = (HttpWebRequest)WebRequest.Create("http://www.productimageswebsite.com/images/stock_jpgs/34891.jpg");// returned values are returned as a stream, then read into a stringString lsResponse = string.Empty;using (HttpWebResponse lxResponse = (HttpWebResponse)lxRequest.GetResponse()){ using (BinaryReader reader = new BinaryReader(lxResponse.GetResponseStream())) { Byte[] lnByte = reader.ReadBytes(1 * 1024 * 1024 * 10); using (FileStream lxFS = new FileStream("34891.jpg", FileMode.Create)) { lxFS.Write(lnByte, 0, lnByte.Length); } }}MessageBox.Show("done");


