使用httpClient将图片读取到PictureBox

时间:2019-02-11 15:56:36

标签: c# httpclient

我需要从网页中读取图像并在图片框内进行检索。 第一个问题我需要检索为字符串还是Base64格式?或者我可以直接将其保存到我的图片框中?

 string url="xxxx";
 using (var client = new HttpClient())
                {

                    client.Timeout = TimeSpan.FromMilliseconds(20000);
                    var response = await client.GetAsync(url);
                    if (response.IsSuccessStatusCode)
                    {
                        string content = await response.Content.ReadAsStringAsync();
                    }
                }

我该怎么做?要在图片盒中发送?

0 个答案:

没有答案