private void button_NewDay_Click(object sender, EventArgs e) { string Path_S = CurPath + "\\" + Config.LastWork; if (Config.LastWork == "") { MessageBox.Show("日期超过限制--" + textBox1.Text + "月" + "或者本目录下文件夹为空"); return; } String Path_D = DirOperate_Temp.CreateDirAccordingCurDate(); DirOperate_Temp.CopyDirectory(Path_S, Path_D); Config.LastWork = Path_D.Substring(CurPath.Length + 1, 24); WriteBinary(Config, Str_Config, ref resultBinary); String Date_S = Path_S.Substring(Path_S.Length - 24, 24); String Date_D = Path_D.Substring(Path_D.Length - 24, 24); MessageBox.Show("Copy Dir From " + Date_S + " to " + Date_D); if (checkBox1.Checked == true) { Config = (ConfigInf)ReadBinary(Str_Config, ref resultBinary); String Path = CurPath + "\\" + Config.LastWork + "\\" + Config.CWD; RunFile(Path); Config.OpenProject = true; } if (checkBox2.Checked == true) { OpenSource(); Config.OpenSourcefile = true; } WriteBinary(Config, Str_Config, ref resultBinary); }
public void OpenSource() { Config = (ConfigInf)ReadBinary(Str_Config, ref resultBinary); foreach (String File in Config.FileName) { RunFile(CurPath + "\\" + Config.LastWork + "\\" + File); } }
public void Initial() { if (File.Exists(CurPath + "\\" + Str_Config)) { Config = (ConfigInf)ReadBinary(Str_Config, ref resultBinary); } else { resultBinary.Result = false; } if (resultBinary.Result == false || Config.CWD == "") { MessageBox.Show("配置文件异常,请稍后创建"); } checkBox1.Checked = Config.OpenProject; checkBox2.Checked = Config.OpenSourcefile; Lated_Dir = DirOperate_Temp.FindLatedDir(int.Parse(textBox1.Text)); if (Lated_Dir != "") { Config.LastWork = Lated_Dir; toolStripStatusLabel2.Text = Lated_Dir; } }
private void button_ReadConfig_Click(object sender, EventArgs e) { Config = (ConfigInf)ReadBinary(Str_Config, ref resultBinary); textBox2.Text = Config.CWD; }