龙
龙卷风241
Unregistered / Unconfirmed
GUEST, unregistred user!
//创建实例
private void createwatch(FileSystemWatcher watchclass,string path,string filter)
{
watchclass = new FileSystemWatcher(path,filter);
watchclass.Created += new FileSystemEventHandler(watchclass_Created);
watchclass.EnableRaisingEvents = true;
}
private void button2_Click(object sender, System.EventArgs e)
{
if(button2.Text=="开始监视")
{
FileSystemWatcher.
createwatch(new FileSystemWatcher(),filepath,filter);
button2.Text="停止监视";
}
else
{
???怎么写这个函数(StopWatch()
button2.Text="开始监视";
}
private void createwatch(FileSystemWatcher watchclass,string path,string filter)
{
watchclass = new FileSystemWatcher(path,filter);
watchclass.Created += new FileSystemEventHandler(watchclass_Created);
watchclass.EnableRaisingEvents = true;
}
private void button2_Click(object sender, System.EventArgs e)
{
if(button2.Text=="开始监视")
{
FileSystemWatcher.
createwatch(new FileSystemWatcher(),filepath,filter);
button2.Text="停止监视";
}
else
{
???怎么写这个函数(StopWatch()
button2.Text="开始监视";
}