So let’s say a computer that does nothing but run this program has 500 power. When it runs it, it goes down to 450. When it the program is closed, will it go back to 500? Code:
bool shouldCheck = true;
string word = "hndxgfhesufyhsukj";
string name = "NAME OF PROGRAM HERE";
bool updates = false;
private void button1_Click(object sender, EventArgs e)
{
if (shouldCheck == true)
{
var url = "MYURL";
var client = new WebClient();
using (var stream = client.OpenRead(url))
using (var reader = new StreamReader(stream))
{
string downloadedString;
while ((downloadedString = reader.ReadLine()) != null)
{
if (downloadedString == word)
{
updates = true;
this.Hide();
Form1 form2 = new Form1();
form2.Show();
MessageBox.Show("There's no updates, and the full program has opened! Enjoy!", name, MessageBoxButtons.OK, MessageBoxIcon.Information);
client.Dispose();
}
else
{
MessageBox.Show("There is an update! Downloading now!", name, MessageBoxButtons.OK, MessageBoxIcon.Information);
url = "MYURL";
var web = new WebBrowser();
web.Navigate(url);
}
}
}
}
}
This runs fine, but does it harm performance after the program has closed? By closed, I mean the update has been checked for, the new form opened, and closed using the red X button.
The answer is yes, it should go back to full power. You can check in task manager to make sure your program has closed correctly. If it is gone it would be hard pressed to continue to have a performance impact on your machine. One thing you need to look out for is if the form is closed but the application is still running in the background. If it is it will be listed in task manager.