fork download
  1. Uri uri = new Uri("http://w...content-available-to-author-only...o.jp/intl/ja_jp/images/logo.gif");
  2.  
  3. using (WebClient web = new WebClient())
  4. using (BufferedStream imgData = new BufferedStream(web.OpenRead(uri)))
  5. using (MemoryStream memory = new MemoryStream())
  6. {
  7. int data = -1;
  8. while ((data = imgData.ReadByte()) != -1)
  9. {
  10. memory.WriteByte((byte)data);
  11. }
  12. memory.Seek(0, SeekOrigin.Begin);
  13.  
  14. BitmapImage bi = new BitmapImage();
  15. bi.BeginInit();
  16. bi.CacheOption = BitmapCacheOption.OnLoad;
  17. bi.StreamSource = memory;
  18. bi.EndInit();
  19.  
  20. image.Source = bi;
  21. }
  22.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty