我试着让这个表每12小时清空一次
我的代码:
#region Vote System
if (DateTime.Now.Hour == 12 && DateTime.Now.Minute == 00 && DateTime.Now.Second == 00)
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.DELETE).Delete("votes", "delete", "1");
cmd.Execute();
}
if (DateTime.Now.Hour == 23 && DateTime.Now.Minute == 59 && DateTime.Now.Second == 40)
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.DELETE).Delete("votes", "delete", "1");
cmd.Execute();
}
#endregion
我的控制台没有错误,我不知道为什么这段代码无效