Well, I'm creating an update system, and it's giving error on one part
WebClient web = new WebClient();
string DownloadVersion = web.DownloadString("https://drive.google.com/uc?authuser=0&id=1bpVdsyUj3oOn1gLbcVRE7uZjIczI5Yc_&export=download");
string UltimaVersao = DownloadVersion.Split('\n')[0];
string VersaoDessePrograma = Application.ProductVersion;
if (Convert.ToDecimal(VersaoDessePrograma) < Convert.ToDecimal(UltimaVersao))
{
if (MessageBox.Show("Um novo update está disponivel!" + Environment.NewLine + "Você quer atualizar?", "Atualização", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
web.DownloadFile(DownloadVersion.Split('\n')[1], "Algoritmos 1.0.1.exe");
MessageBox.Show("O programa foi baixado!" + Environment.NewLine + "O aplicativo será fechado.", "Atualização", MessageBoxButtons.OK, MessageBoxIcon.Information);
System.Diagnostics.Process.Start(Application.StartupPath + @"\Algoritmos 1.0.1.exe");
Close();
}
}
else
{
MessageBox.Show("O programa já está atualizado!", "Verificador", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
This error is as follows, when I put in the line web.DownloadFile
in the part of fileName the following code: Algoritmos 1.0.1.exe
works out, normally. But when I use the variable of the latest version: Algoritmos " + UltimaVersao + ".exe
, it throws an error.
Go to image using code Algoritmos 1.0.1.exe
:
GotoimageusingcodeAlgoritmos" + UltimaVersao + ".exe
:
Why does this error occur? How to solve? Can you help me? Thanks!