日期:2014-05-17  浏览次数:20869 次

C# 通过WebRequest去访问一个图片的url连接怎么读取图片
C# code

WebRequest webRequest = WebRequest.Create("http://nd.fjsen.com/images/attachement/jpg/site162/20120313/00248c4cdbd010c9321004.jpg");
            HttpWebRequest request = webRequest as HttpWebRequest;
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            string encoding = response.ContentEncoding;
            StreamReader reader = new StreamReader(response.GetResponseStream());
            var xx = reader.ReadToEnd();
            byte[] picbyte = Encoding.Default.GetBytes(xx);



------解决方案--------------------
结贴啊。