ふらっとC#,C♯,C#(初心者用) Part41at TECH
ふらっとC#,C♯,C#(初心者用) Part41 - 暇つぶし2ch257: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