diff --git a/Novel.cs b/Novel.cs index a261b6a..08067a0 100644 --- a/Novel.cs +++ b/Novel.cs @@ -17,6 +17,8 @@ class Novel public string descriptions; public int chapterCount; public int chapterDone; + public int startDlChapter; + public int endDlChapter; private int novelid; private string savePath; public bool isFinnished; diff --git a/frmMain.Designer.cs b/frmMain.Designer.cs index d19a5d0..5b42bb6 100644 --- a/frmMain.Designer.cs +++ b/frmMain.Designer.cs @@ -72,6 +72,8 @@ private void InitializeComponent() this.linkLabel1 = new System.Windows.Forms.LinkLabel(); this.linkLabel2 = new System.Windows.Forms.LinkLabel(); this.lblPromptD = new System.Windows.Forms.Label(); + this.txtStartChap = new System.Windows.Forms.TextBox(); + this.txtEndChap = new System.Windows.Forms.TextBox(); this.grpBookInfo.SuspendLayout(); this.grpConfig.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.picVerifyCode)).BeginInit(); @@ -81,7 +83,7 @@ private void InitializeComponent() // btnGetIndex // this.btnGetIndex.Font = new System.Drawing.Font("微软雅黑", 9F); - this.btnGetIndex.Location = new System.Drawing.Point(346, 66); + this.btnGetIndex.Location = new System.Drawing.Point(346, 55); this.btnGetIndex.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.btnGetIndex.Name = "btnGetIndex"; this.btnGetIndex.Size = new System.Drawing.Size(108, 27); @@ -110,7 +112,7 @@ private void InitializeComponent() this.lblChapterCnt.AutoSize = true; this.lblChapterCnt.Location = new System.Drawing.Point(245, 22); this.lblChapterCnt.Name = "lblChapterCnt"; - this.lblChapterCnt.Size = new System.Drawing.Size(28, 31); + this.lblChapterCnt.Size = new System.Drawing.Size(21, 24); this.lblChapterCnt.TabIndex = 4; this.lblChapterCnt.Text = "0"; // @@ -121,7 +123,7 @@ private void InitializeComponent() this.lblFinnished.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); this.lblFinnished.Location = new System.Drawing.Point(274, 22); this.lblFinnished.Name = "lblFinnished"; - this.lblFinnished.Size = new System.Drawing.Size(62, 31); + this.lblFinnished.Size = new System.Drawing.Size(48, 25); this.lblFinnished.TabIndex = 5; this.lblFinnished.Text = "完结"; this.lblFinnished.Visible = false; @@ -132,7 +134,7 @@ private void InitializeComponent() this.label3.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label3.Location = new System.Drawing.Point(202, 22); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(86, 31); + this.label3.Size = new System.Drawing.Size(66, 25); this.label3.TabIndex = 3; this.label3.Text = "章节:"; // @@ -141,7 +143,7 @@ private void InitializeComponent() this.lblAuthor.AutoSize = true; this.lblAuthor.Location = new System.Drawing.Point(60, 22); this.lblAuthor.Name = "lblAuthor"; - this.lblAuthor.Size = new System.Drawing.Size(86, 31); + this.lblAuthor.Size = new System.Drawing.Size(64, 24); this.lblAuthor.TabIndex = 2; this.lblAuthor.Text = "某太太"; // @@ -160,7 +162,7 @@ private void InitializeComponent() this.label1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label1.Location = new System.Drawing.Point(6, 22); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(86, 31); + this.label1.Size = new System.Drawing.Size(66, 25); this.label1.TabIndex = 0; this.label1.Text = "作者:"; // @@ -168,7 +170,7 @@ private void InitializeComponent() // this.btnStart.Enabled = false; this.btnStart.Font = new System.Drawing.Font("微软雅黑", 15F); - this.btnStart.Location = new System.Drawing.Point(346, 107); + this.btnStart.Location = new System.Drawing.Point(346, 118); this.btnStart.Name = "btnStart"; this.btnStart.Size = new System.Drawing.Size(108, 45); this.btnStart.TabIndex = 3; @@ -190,7 +192,7 @@ private void InitializeComponent() // this.txtSaveLoc.Location = new System.Drawing.Point(15, 53); this.txtSaveLoc.Name = "txtSaveLoc"; - this.txtSaveLoc.Size = new System.Drawing.Size(413, 39); + this.txtSaveLoc.Size = new System.Drawing.Size(413, 31); this.txtSaveLoc.TabIndex = 5; // // label4 @@ -199,7 +201,7 @@ private void InitializeComponent() this.label4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label4.Location = new System.Drawing.Point(10, 26); this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(117, 31); + this.label4.Size = new System.Drawing.Size(89, 25); this.label4.TabIndex = 6; this.label4.Text = "保存路径:"; // @@ -238,7 +240,7 @@ private void InitializeComponent() this.chkIgnoreFontDecodingError.AutoSize = true; this.chkIgnoreFontDecodingError.Location = new System.Drawing.Point(319, 196); this.chkIgnoreFontDecodingError.Name = "chkIgnoreFontDecodingError"; - this.chkIgnoreFontDecodingError.Size = new System.Drawing.Size(398, 35); + this.chkIgnoreFontDecodingError.Size = new System.Drawing.Size(300, 28); this.chkIgnoreFontDecodingError.TabIndex = 24; this.chkIgnoreFontDecodingError.Text = "使用?替代V章中解码失败的字符"; this.toolTip1.SetToolTip(this.chkIgnoreFontDecodingError, "选中后,如果VIP章节中的加密文字解密失败,则使用问号替代且继续下载。仅在解码错误较少且下载内容可读时勾选。"); @@ -260,7 +262,7 @@ private void InitializeComponent() this.label9.AutoSize = true; this.label9.Location = new System.Drawing.Point(234, 195); this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(86, 31); + this.label9.Size = new System.Drawing.Size(64, 24); this.label9.TabIndex = 23; this.label9.Text = "验证码"; // @@ -291,7 +293,7 @@ private void InitializeComponent() this.chkUsePwdMask.CheckState = System.Windows.Forms.CheckState.Checked; this.chkUsePwdMask.Location = new System.Drawing.Point(228, 155); this.chkUsePwdMask.Name = "chkUsePwdMask"; - this.chkUsePwdMask.Size = new System.Drawing.Size(94, 35); + this.chkUsePwdMask.Size = new System.Drawing.Size(72, 28); this.chkUsePwdMask.TabIndex = 17; this.chkUsePwdMask.Text = "密码"; this.chkUsePwdMask.UseVisualStyleBackColor = true; @@ -302,7 +304,7 @@ private void InitializeComponent() this.label8.AutoSize = true; this.label8.Location = new System.Drawing.Point(8, 158); this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(86, 31); + this.label8.Size = new System.Drawing.Size(64, 24); this.label8.TabIndex = 16; this.label8.Text = "用户名"; // @@ -311,14 +313,14 @@ private void InitializeComponent() this.txtPwd.Location = new System.Drawing.Point(289, 153); this.txtPwd.Name = "txtPwd"; this.txtPwd.PasswordChar = '*'; - this.txtPwd.Size = new System.Drawing.Size(139, 39); + this.txtPwd.Size = new System.Drawing.Size(139, 31); this.txtPwd.TabIndex = 15; // // txtUsername // this.txtUsername.Location = new System.Drawing.Point(62, 153); this.txtUsername.Name = "txtUsername"; - this.txtUsername.Size = new System.Drawing.Size(160, 39); + this.txtUsername.Size = new System.Drawing.Size(160, 31); this.txtUsername.TabIndex = 14; this.txtUsername.Leave += new System.EventHandler(this.txtUsername_Leave); // @@ -327,7 +329,7 @@ private void InitializeComponent() this.label7.AutoSize = true; this.label7.Location = new System.Drawing.Point(100, 91); this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(88, 31); + this.label7.Size = new System.Drawing.Size(67, 24); this.label7.TabIndex = 13; this.label7.Text = "http://"; // @@ -336,7 +338,7 @@ private void InitializeComponent() this.chkUseMobileEdition.AutoSize = true; this.chkUseMobileEdition.Location = new System.Drawing.Point(156, 123); this.chkUseMobileEdition.Name = "chkUseMobileEdition"; - this.chkUseMobileEdition.Size = new System.Drawing.Size(166, 35); + this.chkUseMobileEdition.Size = new System.Drawing.Size(126, 28); this.chkUseMobileEdition.TabIndex = 12; this.chkUseMobileEdition.Text = "使用手机版"; this.chkUseMobileEdition.UseVisualStyleBackColor = true; @@ -346,7 +348,7 @@ private void InitializeComponent() this.txtProxyPort.Enabled = false; this.txtProxyPort.Location = new System.Drawing.Point(354, 88); this.txtProxyPort.Name = "txtProxyPort"; - this.txtProxyPort.Size = new System.Drawing.Size(55, 39); + this.txtProxyPort.Size = new System.Drawing.Size(55, 31); this.txtProxyPort.TabIndex = 11; this.txtProxyPort.Text = "80"; // @@ -355,7 +357,7 @@ private void InitializeComponent() this.label6.AutoSize = true; this.label6.Location = new System.Drawing.Point(339, 90); this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(20, 31); + this.label6.Size = new System.Drawing.Size(14, 24); this.label6.TabIndex = 10; this.label6.Text = ":"; // @@ -364,7 +366,7 @@ private void InitializeComponent() this.txtProxyServ.Enabled = false; this.txtProxyServ.Location = new System.Drawing.Point(156, 88); this.txtProxyServ.Name = "txtProxyServ"; - this.txtProxyServ.Size = new System.Drawing.Size(179, 39); + this.txtProxyServ.Size = new System.Drawing.Size(179, 31); this.txtProxyServ.TabIndex = 9; // // chkUseProxy @@ -372,7 +374,7 @@ private void InitializeComponent() this.chkUseProxy.AutoSize = true; this.chkUseProxy.Location = new System.Drawing.Point(15, 90); this.chkUseProxy.Name = "chkUseProxy"; - this.chkUseProxy.Size = new System.Drawing.Size(142, 35); + this.chkUseProxy.Size = new System.Drawing.Size(108, 28); this.chkUseProxy.TabIndex = 8; this.chkUseProxy.Text = "使用代理"; this.chkUseProxy.UseVisualStyleBackColor = true; @@ -383,7 +385,7 @@ private void InitializeComponent() this.chkSplitChapter.AutoSize = true; this.chkSplitChapter.Location = new System.Drawing.Point(14, 123); this.chkSplitChapter.Name = "chkSplitChapter"; - this.chkSplitChapter.Size = new System.Drawing.Size(214, 35); + this.chkSplitChapter.Size = new System.Drawing.Size(162, 28); this.chkSplitChapter.TabIndex = 7; this.chkSplitChapter.Text = "每章节一个文件"; this.chkSplitChapter.UseVisualStyleBackColor = true; @@ -401,7 +403,7 @@ private void InitializeComponent() this.txtVerifyCode.Enabled = false; this.txtVerifyCode.Location = new System.Drawing.Point(289, 192); this.txtVerifyCode.Name = "txtVerifyCode"; - this.txtVerifyCode.Size = new System.Drawing.Size(139, 39); + this.txtVerifyCode.Size = new System.Drawing.Size(139, 31); this.txtVerifyCode.TabIndex = 16; // // lblPromptM @@ -417,18 +419,18 @@ private void InitializeComponent() // label5 // this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(358, 163); + this.label5.Location = new System.Drawing.Point(358, 167); this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(110, 31); + this.label5.Size = new System.Drawing.Size(82, 24); this.label5.TabIndex = 9; this.label5.Text = "已完成:"; // // lblCntDone // this.lblCntDone.AutoSize = true; - this.lblCntDone.Location = new System.Drawing.Point(416, 164); + this.lblCntDone.Location = new System.Drawing.Point(416, 168); this.lblCntDone.Name = "lblCntDone"; - this.lblCntDone.Size = new System.Drawing.Size(28, 31); + this.lblCntDone.Size = new System.Drawing.Size(21, 24); this.lblCntDone.TabIndex = 10; this.lblCntDone.Text = "0"; // @@ -449,16 +451,16 @@ private void InitializeComponent() this.lblProgBar.Font = new System.Drawing.Font("Consolas", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblProgBar.Location = new System.Drawing.Point(69, 363); this.lblProgBar.Name = "lblProgBar"; - this.lblProgBar.Size = new System.Drawing.Size(38, 28); + this.lblProgBar.Size = new System.Drawing.Size(30, 22); this.lblProgBar.TabIndex = 12; this.lblProgBar.Text = "0%"; this.lblProgBar.Visible = false; // // txtNovelID // - this.txtNovelID.Location = new System.Drawing.Point(346, 25); + this.txtNovelID.Location = new System.Drawing.Point(346, 21); this.txtNovelID.Name = "txtNovelID"; - this.txtNovelID.Size = new System.Drawing.Size(108, 39); + this.txtNovelID.Size = new System.Drawing.Size(108, 31); this.txtNovelID.TabIndex = 13; // // lblPromptU @@ -483,7 +485,7 @@ private void InitializeComponent() this.linkLabel1.LinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(64)))), ((int)(((byte)(0))))); this.linkLabel1.Location = new System.Drawing.Point(360, 190); this.linkLabel1.Name = "linkLabel1"; - this.linkLabel1.Size = new System.Drawing.Size(130, 31); + this.linkLabel1.Size = new System.Drawing.Size(97, 24); this.linkLabel1.TabIndex = 15; this.linkLabel1.TabStop = true; this.linkLabel1.Text = "开源许可…"; @@ -496,7 +498,7 @@ private void InitializeComponent() this.linkLabel2.LinkColor = System.Drawing.Color.Teal; this.linkLabel2.Location = new System.Drawing.Point(377, 212); this.linkLabel2.Name = "linkLabel2"; - this.linkLabel2.Size = new System.Drawing.Size(62, 31); + this.linkLabel2.Size = new System.Drawing.Size(46, 24); this.linkLabel2.TabIndex = 16; this.linkLabel2.TabStop = true; this.linkLabel2.Text = "帮助"; @@ -513,11 +515,27 @@ private void InitializeComponent() this.lblPromptD.TabIndex = 17; this.lblPromptD.Click += new System.EventHandler(this.LblPrompt_Click); // + // txtStartChap + // + this.txtStartChap.Location = new System.Drawing.Point(346, 84); + this.txtStartChap.Name = "txtStartChap"; + this.txtStartChap.Size = new System.Drawing.Size(49, 31); + this.txtStartChap.TabIndex = 18; + // + // txtEndChap + // + this.txtEndChap.Location = new System.Drawing.Point(405, 84); + this.txtEndChap.Name = "txtEndChap"; + this.txtEndChap.Size = new System.Drawing.Size(49, 31); + this.txtEndChap.TabIndex = 18; + // // frmMain // - this.AutoScaleDimensions = new System.Drawing.SizeF(14F, 31F); + this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(467, 640); + this.Controls.Add(this.txtEndChap); + this.Controls.Add(this.txtStartChap); this.Controls.Add(this.lblPromptD); this.Controls.Add(this.linkLabel2); this.Controls.Add(this.linkLabel1); @@ -596,6 +614,8 @@ private void InitializeComponent() private System.Windows.Forms.Label label9; private System.Windows.Forms.Label lblPromptD; private System.Windows.Forms.CheckBox chkIgnoreFontDecodingError; + private System.Windows.Forms.TextBox txtStartChap; + private System.Windows.Forms.TextBox txtEndChap; } } diff --git a/frmMain.cs b/frmMain.cs index ad73a64..9ee47ce 100644 --- a/frmMain.cs +++ b/frmMain.cs @@ -28,15 +28,15 @@ public frmMain() private void setProgressBar(float prog) { - this.lblProgBar.Text = ((int)(prog*100)).ToString() + "%"; - int cnt = (int)(prog * 7) ; + this.lblProgBar.Text = ((int)(prog * 100)).ToString() + "%"; + int cnt = (int)(prog * 7); if (!picProgress.Visible || !lblProgBar.Visible) { picProgress.Visible = true; lblProgBar.Visible = true; } if (cnt == 0) return; - while (cnt > progboxes.Count && cnt<=7) + while (cnt > progboxes.Count && cnt <= 7) { PictureBox pb = new PictureBox(); pb.Image = (Image)res.GetObject("picProgress.Image"); @@ -51,7 +51,7 @@ private void setProgressBar(float prog) private void resetProgressBar() { - foreach(PictureBox p in progboxes) + foreach (PictureBox p in progboxes) this.Controls.Remove(p); progboxes.Clear(); lblProgBar.Location = new Point(68, lblProgBar.Location.Y); @@ -66,23 +66,25 @@ private void setPrompt(string text) private void setPrompt(string text, Color c) { - this.Invoke(new Action(() => { - lblPromptU.Text = lblPromptM.Text; - lblPromptU.ForeColor = lblPromptM.ForeColor; - lblPromptM.Text = lblPromptD.Text; - lblPromptM.ForeColor = lblPromptD.ForeColor; - lblPromptD.Text = text; - lblPromptD.ForeColor = c; - toolTip1.SetToolTip(lblPromptU, lblPromptU.Text); - toolTip1.SetToolTip(lblPromptM, lblPromptM.Text); - toolTip1.SetToolTip(lblPromptD, lblPromptD.Text); + this.Invoke(new Action(() => + { + lblPromptU.Text = lblPromptM.Text; + lblPromptU.ForeColor = lblPromptM.ForeColor; + lblPromptM.Text = lblPromptD.Text; + lblPromptM.ForeColor = lblPromptD.ForeColor; + lblPromptD.Text = text; + lblPromptD.ForeColor = c; + toolTip1.SetToolTip(lblPromptU, lblPromptU.Text); + toolTip1.SetToolTip(lblPromptM, lblPromptM.Text); + toolTip1.SetToolTip(lblPromptD, lblPromptD.Text); } )); } private void setVerifyCode(byte[] text) { - this.Invoke(new Action(() => { + this.Invoke(new Action(() => + { txtVerifyCode.Text = ""; if (text.Length == 0) { @@ -97,7 +99,7 @@ private void setVerifyCode(byte[] text) picVerifyCode.Image = Image.FromStream(m); m.Dispose(); } - + } )); } @@ -125,17 +127,19 @@ private void btnGetIndex_Click(object sender, EventArgs e) updateNovelSettings(); if (txtNovelID.Text == "") { - MessageBox.Show("请输入小说id","JJGET-ERROR",MessageBoxButtons.OK,MessageBoxIcon.Error); + MessageBox.Show("请输入小说id", "JJGET-ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); txtNovelID.Focus(); return; } novel.setSaveLoc(txtSaveLoc.Text); try { - if(!novel.getIndex(int.Parse(txtNovelID.Text))) + if (!novel.getIndex(int.Parse(txtNovelID.Text))) throw new ArgumentNullException("正则匹配失败?"); - }catch(Exception ex){ - MessageBox.Show("处理失败!大概是NovelID输错了?\n"+ex.Message, "JJGET-ERROR",MessageBoxButtons.OK,MessageBoxIcon.Error); + } + catch (Exception ex) + { + MessageBox.Show("处理失败!大概是NovelID输错了?\n" + ex.Message, "JJGET-ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); setPrompt("处理失败! ", Color.Red); return; } @@ -153,19 +157,43 @@ private void button1_Click(object sender, EventArgs e) { //novel = new Novel(); //novel.chapterCount = 999; + if (int.TryParse(txtStartChap.Text, out int startchap) && int.TryParse(txtEndChap.Text, out int endchap)) { + if (startchap < 1 || startchap > novel.chapterCount) + { + setPrompt("起始章节有误"); + return; + } + if (endchap < 1 || endchap > novel.chapterCount) + { + setPrompt("截至章节有误"); + return; + } + if (startchap > endchap) + { + setPrompt("起始章节大于结束章节"); + return; + } + novel.startDlChapter = startchap - 1; + novel.endDlChapter = endchap; + } + else + { + novel.startDlChapter = 0; + novel.endDlChapter = novel.chapterCount; + } updateNovelSettings(); if (btnStart.Text == "暂停") { this.need_stop = true; return; } - Novel.Chapter chpt=new Novel.Chapter(); + Novel.Chapter chpt = new Novel.Chapter(); btnStart.Text = "暂停"; resetProgressBar(); - setProgressBar((float)novel.chapterDone / novel.chapterCount); + setProgressBar(0); downloadThread = new Thread(new ThreadStart(() => { - for (int i = novel.chapterDone + 1; i <= novel.chapterCount; i++) + for (int i = novel.startDlChapter + 1; i <= novel.endDlChapter; i++) { Thread.Sleep(233); bool terminate = false; @@ -183,9 +211,9 @@ private void button1_Click(object sender, EventArgs e) } catch (NullReferenceException) { - if(novel.isVipChapter(i)) - setPrompt(("章节" + i + "是VIP章节,"+ - (novel.hasLogin?"可能是账号没有购买,或者登陆过期;请尝试稍后重试":"需要登录后才能下载")), Color.Red); + if (novel.isVipChapter(i)) + setPrompt(("章节" + i + "是VIP章节," + + (novel.hasLogin ? "可能是账号没有购买,或者登陆过期;请尝试稍后重试" : "需要登录后才能下载")), Color.Red); else MessageBox.Show("处理章节" + i + "时正则匹配失败,请联系作者", "JJGET-ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); terminate = true; @@ -226,22 +254,23 @@ private void button1_Click(object sender, EventArgs e) } this.Invoke(new Action(() => { - setProgressBar((float)i / novel.chapterCount); + setProgressBar((float)(i-novel.startDlChapter+1) / (novel.endDlChapter-novel.startDlChapter+1)); lblCntDone.Text = i.ToString(); })); } - this.Invoke(new Action(() => { + this.Invoke(new Action(() => + { btnStart.Text = "开始"; lblProgBar.Visible = false; } )); - setPrompt("《"+novel.name + "》下载结束(* ̄▽ ̄)y "); - if(novel.isFinnished) + setPrompt("《" + novel.name + "》下载结束(* ̄▽ ̄)y "); + if (novel.isFinnished) novel.deleteProgress(); })); downloadThread.Start(); - - + + } private void btnChooseSaveLoc_Click(object sender, EventArgs e) @@ -271,10 +300,12 @@ private void frmMain_Load(object sender, EventArgs e) Program.SetCueText(txtNovelID, "输入NovelID"); Program.SetCueText(txtProxyServ, "代理IP"); Program.SetCueText(txtProxyPort, "代理端口"); + Program.SetCueText(txtStartChap, "起"); + Program.SetCueText(txtEndChap, "止"); lblLoginInfo.Size = new Size(417, 74); - lblLoginInfo.Location = new Point(label8.Location.X+3, lblLoginInfo.Location.Y); + lblLoginInfo.Location = new Point(label8.Location.X + 3, lblLoginInfo.Location.Y); chkIgnoreFontDecodingError.Location = new Point( - lblLoginInfo.Location.X+3, chkIgnoreFontDecodingError.Location.Y); + lblLoginInfo.Location.X + 3, chkIgnoreFontDecodingError.Location.Y); loginRoutine(true); //lblLoginInfo.Visible = true; } @@ -298,7 +329,8 @@ private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs } private bool loginRoutine(bool isCheck) { - Action setctls = new Action(() => { + Action setctls = new Action(() => + { lblLoginInfo.Visible = true; lblLoginInfo.Text = novel.userDetail; chkIgnoreFontDecodingError.Visible = true; @@ -332,7 +364,8 @@ private void chkUsePwdMask_CheckedChanged(object sender, EventArgs e) private void btnLogin_Click(object sender, EventArgs e) { - if(btnLogin.Text == "登陆"){ + if (btnLogin.Text == "登陆") + { if (txtUsername.Text == "" || txtPwd.Text == "") { MessageBox.Show("请输入用户名密码ww", "JJGET-WARNING", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); @@ -349,7 +382,8 @@ private void btnLogin_Click(object sender, EventArgs e) } this.Invoke(new Action(() => btnLogin.Enabled = true)); })).Start(); - }else + } + else { novel.deleteSavedUser(); lblLoginInfo.Visible = false; @@ -366,14 +400,14 @@ private void label2_Click(object sender, EventArgs e) private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { - MessageBox.Show("【下载】\n"+ - "·使用手机版有时可以加快下载速度\n"+ - "·必须登录已购买VIP章节的账户才能下载VIP章节\n"+ - "·勾选使用手机版时,若遇到VIP章节,会自动切换电脑版\n\n"+ - "【连载】\n"+ + MessageBox.Show("【下载】\n" + + "·使用手机版有时可以加快下载速度\n" + + "·必须登录已购买VIP章节的账户才能下载VIP章节\n" + + "·勾选使用手机版时,若遇到VIP章节,会自动切换电脑版\n\n" + + "【连载】\n" + "保留同一目录下的jjget文件即可在下次文章更新后继续下载\n\n" + "【字体xxx中的字符xxx无法解码】\n" + - "如果在下载VIP章节时需要此问题,可以尝试勾选\n"+ + "如果在下载VIP章节时需要此问题,可以尝试勾选\n" + "\"使用?替代V章中解码失败的字符\",\n" + "并人工验证下载文本的可读性\n", "JJGET-HELP", MessageBoxButtons.OK, MessageBoxIcon.Information); } @@ -385,7 +419,8 @@ private void btnOpenDir_Click(object sender, EventArgs e) private void txtUsername_Leave(object sender, EventArgs e) { - new Thread(new ThreadStart(() => { + new Thread(new ThreadStart(() => + { this.Invoke(new Action(() => btnLogin.Enabled = false)); novel.checkVerifyCode(txtUsername.Text, false); this.Invoke(new Action(() => btnLogin.Enabled = true));