private void save_timer_Tick(object sender, EventArgs e) { Console.WriteLine("OK sava"); string cur_dict = System.IO.Directory.GetCurrentDirectory(); // DirectoryInfo d_info = new DirectoryInfo(cur_dict + "\\backup"); //使用 GetLatestFileTimeInfo //获取d:\test文件中,扩展名为.txt的最新文件 FileTimeInfo fi = GetLatestFileTimeInfo(cur_dict + "\\backup", ".sql"); if (fi != null) { Console.WriteLine("文件名:{0} 创建时间:{1}", fi.FileName, fi.FileCreateTime); if (fi.FileCreateTime.CompareTo(DateTime.Now.AddHours(-10)) <= 0) { Console.WriteLine("需要备份了"); SavaAllFrom.SavaAll(); } else { Console.WriteLine("不需要备份"); } } else { Console.WriteLine("文件夹中没有指定扩展名的文件!"); } }
private void pb_save_Click(object sender, EventArgs e) { if (global.power != "999") { MessageBox.Show("权限不够"); return; } SavaAllFrom saf = new SavaAllFrom(); saf.ShowDialog(); }
private void cj_mti_Click(object sender, EventArgs e) { SavaAllFrom saf = new SavaAllFrom(); saf.ShowDialog(); }