WebClient client = new WebClient();
string actual = client.DownloadString("http://mysite.com" + "/version.txt");
string current = Main.GetPluginVersion();
if (!File.Exists(Application.StartupPath + "\\mydll.dll))
{
Uri ui = new Uri("http://mysite.com" + "/mydll.dll");
client.DownloadFile(ui, Application.StartupPath + "\\mydll.dll");
}
if (!actual.Equals(current))
{
isUpdate = true;
DialogResult dial = MessageBox.Show("Доступна новая версия скрипта, обновить?", "Автоматическое обновление", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
if (dial == DialogResult.Yes)
{
Process.Start(Application.StartupPath + "\\AutoUpdater.exe");
this.Close();
}
client.Dispose();
}