问题描述:
我在做模拟的过程中,会有一个文件是一直存在的,但是,模拟做完了它会自动消失,所以想求一个每半小时去判断一下他是不是还在的程序,如果他不在了,就触发一个弹窗的操作。
我会写判断是不是存在指定文件,但是,不会做十分钟检查一次和弹窗~
要C#哦~
可以给出大致用到些什么也成~灰常感谢~C#弹窗
我在做模拟的过程中,会有一个文件是一直存在的,但是,模拟做完了它会自动消失,所以想求一个每半小时去判断一下他是不是还在的程序,如果他不在了,就触发一个弹窗的操作。
我会写判断是不是存在指定文件,但是,不会做十分钟检查一次和弹窗~
要C#哦~
可以给出大致用到些什么也成~灰常感谢~C#弹窗
System.Timers.Timer tm = null;
tm = new System.Timers.Timer(1800000);
tm.Elapsed += new System.Timers.ElapsedEventHandler(ExecuteWork);
tm.AutoReset = true;
tm.Enabled = true;
void ExecuteWork(object sender, ElapsedEventArgs e)
{
if (!File.Exists("路径"))
{
// 弹窗
}
}
tm =new System.Timers.timer(1800000);以及下面的三行
invalid token'+=' in class, struct, or interface member declaration
invalid token')' in class, struct, or interface member declaration
invalid token'(' in class, struct, or interface member declaration
invalid token'=' in class, struct, or interface member declaration
invalid token'=' in class, struct, or interface member declaration