using System.Net;
private void button1_Click(object sender, EventArgs e)
{
HttpWebRequest vHttpWebRequest = (HttpWebRequest)WebRequest.Create(
@"http://www.baidu.com/favicon.ico");
HttpWebResponse vHttpWebResponse = (HttpWebResponse)vHttpWebRequest.GetResponse();
Image vFavicon = Image.FromStream(vHttpWebResponse.GetResponseStream());
pictureBox1.Image = vFavicon;
vHttpWebResponse.Close();
}
![](https://img2024.cnblogs.com/blog/35695/202408/35695-20240826070647288-243310440.jpg)