ふらっとC#,C♯,C#(初心者用) Part41 at TECH
[2ch|▼Menu]
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