ふらっとC#,C♯,C#(初心者用) Part41
at TECH
257:sage
09/06/08 22:46:50
>>242
YES。
ドラッグ&ドロップして、プロパティで、
NotifyFilterをLastWriteにしました。
いまの全コードはこれだけです。
public Form1()
{
InitializeComponent();
this.fileSystemWatcher1.Filter = "tmp.txt";
this.fileSystemWatcher1.NotifyFilter = System.IO.NotifyFilters.LastWrite;
this.fileSystemWatcher1.Path = "C:\\";
}
private void fileSystemWatcher1_Changed(object sender, System.IO.FileSystemEventArgs e)
{
//MessageBox.Show("changed");
string[] lines = System.IO.File.ReadAllLines(file, Encoding.GetEncoding("Shift_JIS"));
label1.Text = lines[1];
label2.Text = lines[2];
label3.Text = lines[3];
label4.Text = lines[4];
label5.Text = lines[5];
}
次ページ続きを表示1を表示最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
4688日前に更新/222 KB
担当:undef