private void btn_Save_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.textBox_SaveName.Text)) { throw new Exception("名称为空,无法保存"); } string temp_File = string.Format("{0}.ini", this.textBox_SaveName.Text); try { if (File.Exists(myfunction.GetProductIniPath(temp_File))) { if (!MsgBoxPop("文件已经存在,是否替换", Color.DarkSeaGreen, MessageBoxButtons.OKCancel)) { return; } } File.Copy(myfunction.GetProductIniPath(GlobalVar.Product + ".ini"), myfunction.GetProductIniPath(temp_File), true); MsgBoxPop("存储成功", Color.LightBlue, MessageBoxButtons.OK); } catch (Exception ex) { ErrMsgBox(ex.Message, "保存失败"); } }
private void ICForm_Load(object sender, EventArgs e) { string filename = myfunction.GetProductIniPath(GlobalVar.Product + ".dwg"); obj_dwg.LoadCADFile(filename, 1); InitialBlock(); }