Exemple #1
0
 private void frmMain_Load(object sender, EventArgs e)
 {
     this.Show(); Application.DoEvents();
     if (!GotSong())
     {
         string sUri = "";
         try
         {
             sUri = new System.Net.WebClient().DownloadString
                        ("http://tox.awardspace.us/div/still_alive.php").Split('%')[1];
             if (!sUri.StartsWith("http://"))
             {
                 throw new Exception();
             }
         }
         catch
         {
             MessageBox.Show("I am unable to track down the \"Still alive\" mp3." + "\r\n" +
                             "I'd check my internets connection if I were you." + "\r\n\r\n" +
                             "F****t.", "OH SHI-", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             System.Diagnostics.Process.GetCurrentProcess().Kill();
         }
         Uri url = new Uri(sUri);
         //Uri url = new Uri("http://www.upfordown.com/public/729/sa.mp3");
         //Uri url = new Uri("http://www.hotlinkfiles.com/files/509105_dqr8c/sa.mp3");
         wc.DownloadProgressChanged += new System.Net.DownloadProgressChangedEventHandler(wc_DownloadProgressChanged);
         wc.DownloadFileAsync(url, "sa.mp3");
     }
     else
     {
         prg.Text           = "Done!";
         cmdGo.Enabled      = true;
         cmdGo4chon.Enabled = true;
     }
 }