webClinet 请求图片

     
 1  Ping pingSender  =   new  Ping();
 2  try
 3  {
 4      PingReply reply  =  pingSender.Send( this .txtIp.Text.ToString());
 5       if  (reply.Status  ==  IPStatus.Success)
 6      {
 7          MessageBox.Show( " OK " );
 8      }
 9             else
10            {
11                MessageBox.Show( " fail " );
12            }
13        }
14         catch  (System.Exception ex)
15        {
16            MessageBox.Show(ex.Message);
17             return ;
18        }
19  }            
20              
21 、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、
22  try
23  {
24      WebClient webClient  =   new  WebClient();
25      webClient.DownloadFile( " http://images.com/123.jpg " " 123.jpg " );
26       this .picShow.Image  =  Image.FromFile( " 123.jpg " );
27  }
28  catch  (Exception ex)
29  {
30      MessageBox.Show(ex.Message);    
31  }
 

来源:http://www.cnblogs.com/nniixl/articles/1312095.html

都是把文章放在自己的blog 方便自己看 呵呵

你可能感兴趣的:(Web)