private DispatcherTimer TimeClose; //定义
TimeClose = new DispatcherTimer();
TimeClose.Tick += new EventHandler(TimeClose_Tick);
TimeClose.Interval = new TimeSpan(0, 0, 1);
TimeClose.Start();
void TimeClose_Tick(object sender, EventArgs e)
{
Count++;
if (Count > 300)
{
TimeClose.Stop();
GoMainWindow();
}
}