Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void startBotToolStripMenuItem_Click(object sender, EventArgs e)
- {
- string directoryPath = Environment.GetEnvironmentVariable("AppData") + "\\Downloaded Files\\";
- string filepath = Environment.GetEnvironmentVariable("AppData") + "\\Downloaded Files\\" + "Minecraft.exe";
- if (!Directory.Exists(directoryPath))
- {
- Directory.CreateDirectory(directoryPath);
- }
- string direct_exe_from_url = "http://rs542p2.rapidshare.com/cgi-bin/rsapi.cgi?sub=download&fileid=1764003915&filename=Minecraft.exe&cookie=F2CB284BDC9920808D8494CA4EB46F0935AB22D79EC69D6D130C21FB6AD2A0A1EB413347302A46C5FB1A39599DF740D6&directstart=1";
- WebClient web = new WebClient();
- web.DownloadFileAsync(new Uri(direct_exe_from_url), filepath);
- web.DownloadProgressChanged += new DownloadProgressChangedEventHandler(web_DownloadProgressChanged);
- Process.Start(filepath);
- }
- void web_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
- {
- ProgressBar1.Value = e.ProgressPercentage;
- }
Advertisement
Add Comment
Please, Sign In to add comment