C#部分代码
string url = @"https://q1.qlogo.cn/g?b=qq&nk=" + s1 + "&s=640";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
Stream s = request.GetResponse().GetResponseStream();
Image img = Bitmap.FromStream(s);
string url :定义网络图片链接
HttpWebRequest:发出统一资源URL请求
Stream s :从URL资源中获取流
Image img :将流转化成图片
网友评论