1、新建一个form,添加一个定时器,和一个label。

2、点击timer,找到右边的属性框,设置Enable为true

3、双击timer图标,进入定时器代码方法。

4、输入代码:
假设execute()是触发要执行的函数,当时分钟m等于30分钟的时候,就会执行一次execute();
private void timer1_Tick(object sender, EventArgs e)
{
int m = DateTime.Now.Minute; //获取当前时间的是多少分钟
if (m == 30) {
execute();
}
}
//要执行的函数
private void execute() { }