این هم کد مربوط این مسئله ای که شما گفتید. یکم وقت گرفت ولی درست کار می کنه.
سوال داشتی بپرس.
این هم کد کاملش
Timer t = new Timer();
string path = "C:\\time.txt";
private void Form1_Load(object sender, EventArgs e)
{
t.Interval = 1000;
if (File.Exists(path))
{
t.Tick += t_Tick;
t.Enabled = true;
}
}
private void button2_Click(object sender, EventArgs e)
{
if (textBox1.Text != "")
{
File.WriteAllText(path, textBox1.Text);
t.Tick += t_Tick;
t.Enabled = true;
}
}
void t_Tick(object sender, EventArgs e)
{
string s;
int n;
s = File.ReadAllText(path);
n = Convert.ToInt32(s);
n -= 1;
textBox1.Text = n.ToString();
File.WriteAllText(path, textBox1.Text);
}