using System;
using System.Threading;
namespace outlook
{
public partial class Form : System.Windows.Forms.Form
{
public Form()
{
InitializeComponent();
}
public void Form_Load(object sender, EventArgs e)
{
start();
}
private void start()
{
//定义Timer类
System.Timers.Timer timer = new System.Timers.Timer();
DateTime now = DateTime.Now;
DateTime oneOClock = DateTime.Today.AddHours(9.0).AddMinutes(30.0); //9:30
if (now > oneOClock)
{
oneOClock = oneOClock.AddDays(1.0);
}
int msUntilFour = (int)((oneOClock - now).TotalMilliseconds);
var t = new System.Threading.Timer(writeLog);
t.Change(msUntilFour, Timeout.Infinite);
}
private void writeLog(object stata)
{