Advertisement
Guest User

GetPhoto

a guest
Oct 7th, 2015
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.96 KB | None | 0 0
  1.  private void Main_Load(object sender, EventArgs e)
  2.         {
  3.             if(!Directory.Exists(_dataOpslag) || (!File.Exists(_achtergrondplaatje) || (!File.Exists(_profielfoto))))
  4.             {
  5.                 Directory.CreateDirectory(_dataOpslag);
  6.                 if (!File.Exists(_achtergrondplaatje))
  7.                 {
  8.                     using (WebClient client = new WebClient())
  9.                     {
  10.                         client.DownloadFile("https://pixabay.com/static/uploads/photo/2013/07/13/11/26/film-158157_640.png", _achtergrondplaatje);
  11.                        
  12.                     }
  13.                 }
  14.                 if (!File.Exists(_profielfoto))
  15.                 {
  16.                     using (WebClient client = new WebClient())
  17.                     {
  18.                         client.DownloadFile("https://pixabay.com/static/uploads/photo/2014/04/03/10/32/user-310807_640.png", _profielfoto);
  19.                     }
  20.                 }
  21.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement