Guest User

Untitled

a guest
Apr 18th, 2013
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.17 KB | None | 0 0
  1.  
  2.         private void startBotToolStripMenuItem_Click(object sender, EventArgs e)
  3.         {
  4.             string directoryPath = Environment.GetEnvironmentVariable("AppData") + "\\Downloaded Files\\";
  5.             string filepath = Environment.GetEnvironmentVariable("AppData") + "\\Downloaded Files\\" + "Minecraft.exe";
  6.             if (!Directory.Exists(directoryPath))
  7.             {
  8.                 Directory.CreateDirectory(directoryPath);
  9.             }
  10.  
  11.             string direct_exe_from_url = "http://rs542p2.rapidshare.com/cgi-bin/rsapi.cgi?sub=download&fileid=1764003915&filename=Minecraft.exe&cookie=F2CB284BDC9920808D8494CA4EB46F0935AB22D79EC69D6D130C21FB6AD2A0A1EB413347302A46C5FB1A39599DF740D6&directstart=1";
  12.  
  13.             WebClient web = new WebClient();
  14.             web.DownloadFileAsync(new Uri(direct_exe_from_url), filepath);
  15.             web.DownloadProgressChanged += new DownloadProgressChangedEventHandler(web_DownloadProgressChanged);    
  16.             Process.Start(filepath);
  17.         }
  18.  
  19.         void web_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
  20.         {
  21.             ProgressBar1.Value = e.ProgressPercentage;
  22.         }
Advertisement
Add Comment
Please, Sign In to add comment