private void button1_Click(object sender, EventArgs e) { for (int p = 0; p >= 0; p++) { DateTime dt = File.GetLastWriteTime(filepath); DateTime date = File.GetCreationTime(filepath); if (File.Exists(filepath)) { if (date != dt) { task(); } } } } public void task() { using (FileStream fs = new FileStream(filepath,FileMode.Open,FileAccess.Read)) { using (StreamReader sr = new StreamReader(fs)) { string[] line = sr.ReadLine().Split(','); textBox1.Text = "File update"+ Environment.NewLine; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)