//删除 private void btnDelini_Click(object sender, EventArgs e) { try { if (this.lbxIni.Items.Count > 0) { _Ini ini = new _Ini("Ttyping.ty"); string select = this.lbxIni.SelectedItem.ToString(); string[] idget = select.Split('|'); string get = idget[0].Trim(); ini.IniWriteValue("发文配置", get, null); string temp = ini.IniReadValue("发文面板配置", "总序列", "0"); if (temp != "0") { if (ini.IniReadValue("发文配置", get, "NO") == "NO") { if (temp.Contains(get)) { temp = temp.Remove(temp.IndexOf(get), 2); ini.IniWriteValue("发文面板配置", "总序列", temp); } iniRead(); ClearAll(); } } } } catch { } }
private void cbx乱序全段不重复_CheckedChanged(object sender, EventArgs e) { bool temp = (sender as CheckBox).Checked; _Ini t2 = new _Ini("Ttyping.ty"); if (temp) { t2.IniWriteValue("发文面板配置", "乱序全段不重复", "True"); } else { t2.IniWriteValue("发文面板配置", "乱序全段不重复", "False"); } }
private void btnCancel_Click(object sender, EventArgs e) { Theme.ThemeApply = false; _Ini ini = new _Ini("Ttyping.ty"); ini.IniWriteValue("主题", "是否启用主题", "False"); frm.LoadTheme("", Theme.ThemeColorBG, Theme.ThemeColorFC, Theme.ThemeBG); this.Close(); }
private void radioButtonTab_CheckedChanged(object sender, EventArgs e) { if (radioButtonTab.Checked) { _Ini Setupini = new _Ini("Ttyping.ty"); Glob.getStyle = true; Setupini.IniWriteValue("载入", "方式", "true"); } }
}//个签 public void srfSave() { _Ini Setupini = new _Ini("Ttyping.ty"); if (this.checkBox3.Checked) { if (this.textBox2.Text != "") { Setupini.IniWriteValue("输入法", "签名", this.textBox2.Text); Setupini.IniWriteValue("输入法", "标志", "1"); } else { Setupini.IniWriteValue("输入法", "标志", "0"); } } else { Setupini.IniWriteValue("输入法", "标志", "0"); } } //输入法
public void gQ() { _Ini Setupini = new _Ini("Ttyping.ty"); if (this.checkBox1.Checked) { if (this.textBox1.Text != "") { Setupini.IniWriteValue("个签", "签名", this.textBox1.Text); Setupini.IniWriteValue("个签", "标志", "1"); } else { Setupini.IniWriteValue("个签", "标志", "0"); // 0 表示未设置 } } else { Setupini.IniWriteValue("个签", "标志", "0"); // 0 表示未设置 } }//个签
/// <summary> /// 设置 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnOk_Click(object sender, EventArgs e) { _Ini ini = new _Ini("Ttyping.ty"); ini.IniWriteValue("主题", "是否启用主题", "True"); ini.IniWriteValue("主题", "是否应用主题背景", this.SwitchB1.Checked.ToString()); ini.IniWriteValue("主题", "背景路径", this.lblBGPath.Text); ini.IniWriteValue("主题", "纯色", this.lblPicShow.BackColor.ToArgb().ToString()); ini.IniWriteValue("主题", "主题颜色", this.lblThemeBGShow.BackColor.ToArgb().ToString()); ini.IniWriteValue("主题", "字体颜色", this.lblThemeFCShow.BackColor.ToArgb().ToString()); ini.IniWriteValue("主题", "预览", this.SwitchB2.Checked.ToString()); Theme.isBackBmp = this.SwitchB1.Checked; Theme.ThemeBackBmp = this.lblBGPath.Text; Theme.ThemeBG = this.lblPicShow.BackColor; Theme.ThemeColorBG = this.lblThemeBGShow.BackColor; Theme.ThemeColorFC = this.lblThemeFCShow.BackColor; Theme.ReView = this.SwitchB2.Checked; Theme.ThemeApply = true; this.Close(); }
private void button1_Click(object sender, EventArgs e) { _Ini Setupini = new _Ini("Ttyping.ty"); string srf = Setupini.IniReadValue("输入法", "惯用设置", "0"); if (srf != this.comboBox1.Text) { Setupini.IniWriteValue("输入法", "惯用设置", this.comboBox1.Text); Glob.InstraSrf = this.comboBox1.Text; } gQ();//保存个签 //保存延时 Setupini.IniWriteValue("发送", "延时", this.trackBar1.Value.ToString()); //保存QQ Setupini.IniWriteValue("发送", "QQ", this.textBoxQQ.Text); Setupini.IniWriteValue("发送", "QQSta", this.checkBox21.Checked.ToString()); //保存输入法签名 srfSave(); //颜色设置 Setupini.IniWriteValue("外观", "对照区颜色", buttoncolor1.BackColor.ToArgb().ToString()); Glob.r1Back = buttoncolor1.BackColor; Setupini.IniWriteValue("外观", "跟打区颜色", buttoncolor2.BackColor.ToArgb().ToString()); Setupini.IniWriteValue("外观", "打对颜色", this.pictureBoxRight.BackColor.ToArgb().ToString()); Glob.Right = this.pictureBoxRight.BackColor; Setupini.IniWriteValue("外观", "打错颜色", this.pictureBoxFalse.BackColor.ToArgb().ToString()); Glob.Right = this.pictureBoxFalse.BackColor; //字体设置 FontConverter fc = new FontConverter(); Setupini.IniWriteValue("外观", "对照区字体", fc.ConvertToInvariantString(fo1)); Setupini.IniWriteValue("外观", "跟打区字体", fc.ConvertToInvariantString(fo2)); //Point a1 = frm.richTextBox1.GetPositionFromCharIndex(1); //Point a2 = frm.richTextBox1.GetPositionFromCharIndex(frm.richTextBox1.GetFirstCharIndexFromLine(1)); frm.richTextBox1.Font = fo1; frm.textBoxEx1.Font = fo2; //前导 if (checkBox19.Checked) { if (this.textBoxDuan.Text.Contains("xx")) { Setupini.IniWriteValue("载入", "前导", this.textBoxPreText.Text); Setupini.IniWriteValue("载入", "段标", this.textBoxDuan.Text); Setupini.IniWriteValue("载入", "开启", this.checkBox19.Checked.ToString()); } else { MessageBox.Show("段标输入错误!未保存!", "警告"); return; } } else { Setupini.IniWriteValue("载入", "开启", this.checkBox19.Checked.ToString()); } //跟打完后 是否 激活 if (checkBoxGDQAction.Checked) { Glob.GDQActon = true; Setupini.IniWriteValue("发送", "激活", "true"); } else { Glob.GDQActon = false; Setupini.IniWriteValue("发送", "激活", "false"); } //是否显示曲线 if (checkBox22.Checked) { frm.splitContainer4.Panel1Collapsed = true; Setupini.IniWriteValue("拖动条", "曲线", "true"); } else { frm.splitContainer4.Panel1Collapsed = false; Setupini.IniWriteValue("拖动条", "曲线", "false"); } //停止时间 Setupini.IniWriteValue("控制", "停止", this.trackBar2.Value.ToString()); Glob.StopUse = this.trackBar2.Value; frm.toolTip1.SetToolTip(frm.lblAutoReType, "跟打停止时间,大于" + this.trackBar2.Value + "分钟时自动停止跟打"); //速度限制 Setupini.IniWriteValue("发送", "速度限制", this.numericUpDown1.Value.ToString()); Glob.速度限制 = (double)this.numericUpDown1.Value; Glob.是否速度限制 = this.checkBox30.Checked; if (Glob.是否速度限制) { Glob.是否速度限制 = true; Setupini.IniWriteValue("发送", "是否速度限制", "True"); frm.toolStripBtnLS.ForeColor = Color.White; string tips = frm.toolStripBtnLS.ToolTipText; frm.toolStripBtnLS.ToolTipText = tips.Remove(tips.IndexOf(':') + 1) + Glob.速度限制; } else { Glob.是否速度限制 = false; Setupini.IniWriteValue("发送", "是否速度限制", "False"); frm.toolStripBtnLS.ForeColor = Color.Silver; } //极简模式 Setupini.IniWriteValue("发送", "状态", this.checkBox23.Checked.ToString()); Setupini.IniWriteValue("发送", "分隔符", this.textBox4.Text); Glob.simpleMoudle = this.checkBox23.Checked; Glob.simpleSplite = this.textBox4.Text; frm.toolStripButton2.Checked = this.checkBox23.Checked; if (!saveSort()) { MessageBox.Show(this, "含有错误排序字符,请重新检查!", "添雨跟打器排序提示"); return; } else { Setupini.IniWriteValue("发送", "顺序", textBox3.Text); } //跟打过程中不显示即时数据 if (this.checkBox28.Checked) { Setupini.IniWriteValue("控制", "不显示即时", "True"); Glob.notShowjs = true; } else { Setupini.IniWriteValue("控制", "不显示即时", "False"); Glob.notShowjs = false; } if (this.checkBox1.Checked) { Glob.InstraPre_ = "1"; } else { Glob.InstraPre_ = "0"; } Glob.InstraPre = this.textBox1.Text; //个签 Glob.InstraSrf = this.textBox2.Text; //输入法签名 Glob.InstraSrf_ = IniRead("输入法", "标志", "0"); Glob.binput = true; //输入法修改 Glob.DelaySend = int.Parse(IniRead("发送", "延时", "50")); Glob.sortSend = this.textBox3.Text; Glob.Right = pictureBoxRight.BackColor; Glob.False = pictureBoxFalse.BackColor; frm.richTextBox1.BackColor = this.buttoncolor1.BackColor; frm.textBoxEx1.BackColor = this.buttoncolor2.BackColor; if (checkBox19.Checked) { Glob.PreText = this.textBoxPreText.Text; Glob.PreDuan = this.textBoxDuan.Text.Replace("xx", @"\d+"); Glob.isZdy = true; } else { Glob.PreText = "-----"; Glob.PreDuan = @"第\d+段"; } Glob.isQQ = this.checkBox21.Checked; Glob.QQnumber = this.textBoxQQ.Text; //图片成绩发送昵称 Setupini.IniWriteValue("发送", "昵称", this.tbxName.Text); Glob.PicName = this.tbxName.Text; // Setupini.IniWriteValue("控制", "自动获取", this.checkBox31.Checked.ToString()); if (File.Exists("Ttyping.ty")) { this.Close(); } else { MessageBox.Show("文件丢失!"); } }
/// <summary> /// 保存配置说明 /// 顺序:配置序号 | 文章来源 | 文章地址 | 文章标题 | 当前标记 | /// 发送字数 | 已发字数 | 当前段号 | 是否乱序 | 是否周期 | 周期时间 | 是否独练 |保存时间 /// 配置名称:给配置的命名 可由用户自定义 /// 发文标记:上一次发文断点位置 /// 文章标题:发文的文章标题 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSave_Click(object sender, EventArgs e) { //检测当前存在几个配置 try { int count = AllIniCount; int infoNo; bool SetupAll = true; if (NewSendText.当前配置序列.Length != 0) { DialogResult temp = MessageBox.Show("当前配置序列为:" + NewSendText.当前配置序列 + ",确认要覆盖该配置?\n点击是:覆盖配置\n点击否:重新建立新配置", "保存配置提示", MessageBoxButtons.YesNoCancel); switch (temp) { case DialogResult.Yes: infoNo = int.Parse(NewSendText.当前配置序列); SetupAll = false; break; case DialogResult.No: infoNo = count + 1; //配置序号 break; default: return; } } else { infoNo = count + 1;//配置序号 } NewSendText.当前配置序列 = infoNo.ToString(); string infoTextSources = NewSendText.文章来源.ToString(); string infoTextAdd = NewSendText.文章地址; string infoTextTitle = NewSendText.标题; string infoNowStart = NewSendText.标记.ToString(); string infoSendTextCount = NewSendText.发送字数.ToString(); //发送字数 string infoHaveSend = NewSendText.已发字数.ToString(); string infoNowDuan = this.tbxNowStartCount.Text; //当前段号 string infoIsInOrder = NewSendText.是否乱序.ToString(); string infoIsT = NewSendText.是否周期.ToString(); string infoTTime = NewSendText.周期长度.ToString(); string infoisMyseft = NewSendText.是否独练.ToString(); _Ini setupini = new _Ini("Ttyping.ty"); string getALL_ = setupini.IniReadValue("发文面板配置", "总序列", "0"); if (getALL_ != "0") { if (getALL_.Contains(infoNo.ToString())) { if (SetupAll) { for (int i = 1; i <= 50; i++) { if (!getALL_.Contains(i.ToString())) { //if (MessageBox.Show("找到未用到的配置序列:" + i + "\n是否使用?", "配置序列说明", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) //{ infoNo = i; NewSendText.当前配置序列 = i.ToString(); getALL_ += infoNo + "|"; setupini.IniWriteValue("发文面板配置", "总序列", getALL_); break; //} //else //{ // return; // } } } } } else { getALL_ += infoNo + "|"; setupini.IniWriteValue("发文面板配置", "总序列", getALL_); } } else { setupini.IniWriteValue("发文面板配置", "总序列", infoNo + "|"); } //配置集中 string info = infoNo + "|" + infoTextSources + "|" + infoTextAdd + "|" + infoTextTitle + "|" + (int.Parse(infoNowStart) - int.Parse(infoSendTextCount)) + "|" + infoSendTextCount + "|" + (int.Parse(infoHaveSend) - int.Parse(infoSendTextCount)) + "|" + infoNowDuan + "|" + infoIsInOrder + "|" + infoIsT + "|" + infoTTime + "|" + infoisMyseft + "|" + DateTime.Now; setupini.IniWriteValue("发文配置", infoNo.ToString(), info.ToString()); MessageBox.Show("保存成功!发文配置序列:" + infoNo, "保存提示", MessageBoxButtons.OK); this.lblAll.Text = ReadKeys("发文配置").Count.ToString(); this.lblNowIni.Text = infoNo.ToString(); } catch { } }