I'm working on a simple updater program that gets text from a file called version.dv that will always have a number in the form of 1.00, 1.15, 2.00
I can't figure out how to get it to read the file and save the text to a string though. Here's what I have, but I have no idea where to go. If anyone has ideas, I would be in your debt.
private void button2_Click(object sender, EventArgs e)
{
//Open Version.DV
//Check number (1.00)
//If number is less, update. If not, switch to play now.
using (StreamReader sr = new StreamReader("c:\\version.DV"))
{
String line;
// Read and display lines from the file until the end of
// the file is reached.
while ((line = sr.ReadLine()) != null)
{
Console.WriteLine(line);
}
double linevalue = Convert.ToDouble(line);
if (linevalue > 3.00)
{
Application.Exit();
}
else
{
mainbut.Text = "Play!";
}
}
}