- 237 名前:sage [2009/06/08(月) 21:28:25 ]
- VisualC#2008で、再表示がうまくできずに困っています。
fileSystemWatcher でファイルを監視し、ファイルを読みこんで表示しようとしています。 string file = @"C:\tmp.txt"; public Form1() { InitializeComponent(); } private void fileSystemWatcher1_Changed(object sender, System.IO.FileSystemEventArgs e) { string[] lines = System.IO.File.ReadAllLines(file, Encoding.GetEncoding("Shift_JIS")); //MessageBox.Show(lines[1]); label1.Text = lines[1]; label2.Text = lines[2]; label3.Text = lines[3]; label4.Text = lines[4]; label5.Text = lines[5]; } 監視はできているようなのですが、2度めの表示が行われません。 どこがまずいんでしょうか。
|

|