在 Form1.Load 中,我有:
MessageBox.Show("Text blah blah blah");
在您按 OK 之前,这是任务栏中的图标:
当您按 OK 时,它会变为图标:
如何让它在启动时更新?
我通过在表单属性中更改图标来更改它:
整个“加载”功能:
string word = "1.4";
var url = "http://chipperyman573.com/rtf/textbot.html";
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)
{
update = false;
MessageBox.Show("Congrats! You are running the latest version (" + word + ") of Chip Bot!\n\nGot an idea for this program? Use the \"Send feedback\" button to let me know!", "Chip Bot", MessageBoxButtons.OK, MessageBoxIcon.Information);
Text = "Chip Bot" + word + " - Got an idea for this program? Send me some feedback!";
}
else
{
Text = "Chip Bot (UPDATE AVAILABLE)";
go.ForeColor = Color.Gray;
setup.Enabled = false;
otherGroup.Enabled = false;
optionsGroup.Enabled = false;
MessageBox.Show("There is an update! Downloading now! \n\nUNTIL YOU UPDATE THE PROGRAM WILL NOT FUNCTION.", "Chip Bot", MessageBoxButtons.OK, MessageBoxIcon.Information);
url = "";
var web = new WebBrowser();
web.Navigate(url);
}
}
}
无论是否有更新 ( downloadstring != word
) 或没有更新 ( downloadstring == word
)它都会执行此操作