//开始复制图片 private void btn_Start_Click(object sender, EventArgs e) { //判断目标文件夹是否存在,不存在则创建文件 if (!Directory.Exists(txtTargetPath.Text)) { Directory.CreateDirectory(txtTargetPath.Text); } new Thread(run).Start(); picRunning.Visible = true; //保存本次信息 OperateIni.WriteIniData(IniSection, "sourcePath", txtSourcePath.Text); OperateIni.WriteIniData(IniSection, "targetPath", txtTargetPath.Text); OperateIni.WriteIniData(IniSection, "excludeFloder", txtExcludeFloder.Text); ImgType type = new ImgType(); switch (cmbImgType.Text) { case "横图": type = ImgType.Horizon; break; case "竖图": type = ImgType.Vertical; break; default: break; } OperateIni.WriteIniData(IniSection, "imgType", (int)type); OperateIni.WriteIniData(IniSection, "minImgWidth", txtMinImgWidth.Text); OperateIni.WriteIniData(IniSection, "startAt", DateTime.Now); OperateIni.WriteIniData(IniSection, "checkTime", checkTime.Checked); }
/// <summary> /// 更新用户登陆Logo地址 /// </summary> void RefreshLogo() { string logoUrl = Config.User.LogoUrl; string iniPath = AppDomain.CurrentDomain.BaseDirectory + "Config.ini"; OperateIni.WriteIniData("Enveronment", "logoUrl", logoUrl, iniPath); }
//开始重排序图片 private void btn_Relist_Click(object sender, EventArgs e) { new Thread(run).Start(); picRunning.Visible = true; //保存本次设置 OperateIni.WriteIniData(IniSection, "sourcePath", txtSourcePath.Text); OperateIni.WriteIniData(IniSection, "targetPath", txtTargetPath.Text); OperateIni.WriteIniData(IniSection, "excludeFloder", txtExcludeFloder.Text); ImgType type = new ImgType(); switch (cmbImgType.Text) { case "横图": type = ImgType.Horizon; break; case "竖图": type = ImgType.Vertical; break; default: break; } OperateIni.WriteIniData(IniSection, "imgType", (int)type); OperateIni.WriteIniData(IniSection, "minImgWidth", txtMinImgWidth.Text); OperateIni.WriteIniData(IniSection, "startAt", dtpStart.Value); OperateIni.WriteIniData(IniSection, "checkTime", checkTime.Checked); OperateIni.WriteIniData(IniSection, "checkCopy", checkCopy.Checked); OperateIni.WriteIniData(IniSection, "checkDeep", checkDeep.Checked); OperateIni.WriteIniData(IniSection, "limitNum", txtLimitNum.Text); OperateIni.WriteIniData(IniSection, "txtSortReg", txtSortReg.Text); }
public Login() { InitializeComponent(); txtPassword.KeyPress += new KeyPressEventHandler(this.txtPassword_KeyPress); //读取用户Logo string iniPath = AppDomain.CurrentDomain.BaseDirectory + "Config.ini"; string url = OperateIni.ReadIniData("Enveronment", "logoUrl", iniPath); picLogo.ImageLocation = url; }
public SelectImgPanel() { InitializeComponent(); Control.CheckForIllegalCrossThreadCalls = false; rtxtPicList.Text = ""; txtMinImgWidth.KeyPress += new KeyPressEventHandler(ControlEvent.NumLimit); //加载上一次目录信息 txtSourcePath.Text = OperateIni.ReadIniData(IniSection, "sourcePath"); txtTargetPath.Text = OperateIni.ReadIniData(IniSection, "targetPath"); txtExcludeFloder.Text = OperateIni.ReadIniData(IniSection, "excludeFloder"); //加载图片条件 string strType = OperateIni.ReadIniData(IniSection, "imgType"); if (!string.IsNullOrEmpty(strType)) { ImgType type = (ImgType)Convert.ToInt32(strType); switch (type) { case ImgType.Horizon: cmbImgType.Text = "横图"; break; case ImgType.Vertical: cmbImgType.Text = "竖图"; break; default: break; } } txtMinImgWidth.Text = OperateIni.ReadIniData(IniSection, "minImgWidth"); string strStartAt = OperateIni.ReadIniData(IniSection, "startAt"); if (!string.IsNullOrEmpty(strStartAt)) { DateTime startAt = new DateTime(); DateTime.TryParse(strStartAt, out startAt); dtpStart.Value = startAt; } string strCheckTime = OperateIni.ReadIniData(IniSection, "checkTime"); if (!string.IsNullOrEmpty(strCheckTime)) { checkTime.Checked = Convert.ToBoolean(strCheckTime); } }