From 8e7df9ce5db2981096cba82771102105a49fce30 Mon Sep 17 00:00:00 2001 From: qi rui yang <1844812067@qq.com> Date: Tue, 22 Nov 2016 20:47:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E9=80=9F=E5=BA=A6=E4=B8=8D=E7=A8=B3=E5=AE=9A=E7=AD=89bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BaiduPanDownload/Data/DiskFileInfo.cs | 2 +- BaiduPanDownload/Forms/Main.Designer.cs | 160 ++++++++++---------- BaiduPanDownload/Forms/Main.cs | 8 +- BaiduPanDownload/Forms/Main.resx | 2 +- BaiduPanDownload/Properties/AssemblyInfo.cs | 4 +- 5 files changed, 89 insertions(+), 87 deletions(-) diff --git a/BaiduPanDownload/Data/DiskFileInfo.cs b/BaiduPanDownload/Data/DiskFileInfo.cs index 3e32180..beec640 100644 --- a/BaiduPanDownload/Data/DiskFileInfo.cs +++ b/BaiduPanDownload/Data/DiskFileInfo.cs @@ -40,7 +40,7 @@ public DiskFileInfo[] getFileList() return null; } ArrayList FileList = new ArrayList(); - JObject jobj = JObject.Parse(WebTool.GetHtml($"https://pcs.baidu.com/rest/2.0/pcs/file?method=list&access_token={Program.config.Access_Token}&path={path}")); + JObject jobj = JObject.Parse(WebTool.GetHtml($"https://pcs.baidu.com/rest/2.0/pcs/file?method=list&access_token={Program.config.Access_Token}&path="+ Uri.EscapeDataString(path))); foreach (JObject job in jobj["list"]) { DiskFileInfo fileinfo = JsonConvert.DeserializeObject(job.ToString()); diff --git a/BaiduPanDownload/Forms/Main.Designer.cs b/BaiduPanDownload/Forms/Main.Designer.cs index 50292bc..692c8c5 100644 --- a/BaiduPanDownload/Forms/Main.Designer.cs +++ b/BaiduPanDownload/Forms/Main.Designer.cs @@ -72,16 +72,16 @@ private void InitializeComponent() this.tabPage4 = new System.Windows.Forms.TabPage(); this.label12 = new System.Windows.Forms.Label(); this.label11 = new System.Windows.Forms.Label(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.label7 = new System.Windows.Forms.Label(); + this.Save_Button = new System.Windows.Forms.Button(); + this.label6 = new System.Windows.Forms.Label(); + this.NetSpeed_TextBox = new System.Windows.Forms.TextBox(); + this.button4 = new System.Windows.Forms.Button(); + this.DownloadPath_TextBox = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); this.UpdateDownLoadList_Timer = new System.Windows.Forms.Timer(this.components); this.Test_Button = new System.Windows.Forms.Button(); - this.label5 = new System.Windows.Forms.Label(); - this.DownloadPath_TextBox = new System.Windows.Forms.TextBox(); - this.button4 = new System.Windows.Forms.Button(); - this.NetSpeed_TextBox = new System.Windows.Forms.TextBox(); - this.label6 = new System.Windows.Forms.Label(); - this.Save_Button = new System.Windows.Forms.Button(); - this.label7 = new System.Windows.Forms.Label(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); this.InfoMenu.SuspendLayout(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); @@ -492,39 +492,59 @@ private void InitializeComponent() this.label11.TabIndex = 1; this.label11.Text = "说明"; // - // UpdateDownLoadList_Timer + // groupBox1 // - this.UpdateDownLoadList_Timer.Enabled = true; - this.UpdateDownLoadList_Timer.Interval = 1000; - this.UpdateDownLoadList_Timer.Tick += new System.EventHandler(this.UpdateDownLoadList_Timer_Tick); + this.groupBox1.Controls.Add(this.label7); + this.groupBox1.Controls.Add(this.Save_Button); + this.groupBox1.Controls.Add(this.label6); + this.groupBox1.Controls.Add(this.NetSpeed_TextBox); + this.groupBox1.Controls.Add(this.button4); + this.groupBox1.Controls.Add(this.DownloadPath_TextBox); + this.groupBox1.Controls.Add(this.label5); + this.groupBox1.Location = new System.Drawing.Point(6, 6); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(402, 449); + this.groupBox1.TabIndex = 0; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "下载设置"; // - // Test_Button + // label7 // - this.Test_Button.Location = new System.Drawing.Point(305, 523); - this.Test_Button.Name = "Test_Button"; - this.Test_Button.Size = new System.Drawing.Size(75, 23); - this.Test_Button.TabIndex = 12; - this.Test_Button.Text = "Test"; - this.Test_Button.UseVisualStyleBackColor = true; - this.Test_Button.Visible = false; - this.Test_Button.Click += new System.EventHandler(this.Test_Button_Click); + this.label7.AutoSize = true; + this.label7.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label7.Location = new System.Drawing.Point(12, 89); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(377, 17); + this.label7.TabIndex = 2; + this.label7.Text = "说明:根据物理带宽进行下载加速,请如实填写,填写过高会加大出错风险"; // - // label5 + // Save_Button // - this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(6, 24); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(77, 12); - this.label5.TabIndex = 3; - this.label5.Text = "默认下载路径"; + this.Save_Button.Location = new System.Drawing.Point(144, 417); + this.Save_Button.Name = "Save_Button"; + this.Save_Button.Size = new System.Drawing.Size(102, 27); + this.Save_Button.TabIndex = 7; + this.Save_Button.Text = "保存"; + this.Save_Button.UseVisualStyleBackColor = true; + this.Save_Button.Click += new System.EventHandler(this.Save_Button_Click); // - // DownloadPath_TextBox + // label6 // - this.DownloadPath_TextBox.Location = new System.Drawing.Point(89, 20); - this.DownloadPath_TextBox.Name = "DownloadPath_TextBox"; - this.DownloadPath_TextBox.ReadOnly = true; - this.DownloadPath_TextBox.Size = new System.Drawing.Size(259, 21); - this.DownloadPath_TextBox.TabIndex = 4; + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(101, 62); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(71, 12); + this.label6.TabIndex = 0; + this.label6.Text = "物理带宽(M)"; + // + // NetSpeed_TextBox + // + this.NetSpeed_TextBox.Location = new System.Drawing.Point(181, 56); + this.NetSpeed_TextBox.MaxLength = 3; + this.NetSpeed_TextBox.Name = "NetSpeed_TextBox"; + this.NetSpeed_TextBox.Size = new System.Drawing.Size(65, 21); + this.NetSpeed_TextBox.TabIndex = 1; + this.NetSpeed_TextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.NetSpeed_TextBox_KeyPress); // // button4 // @@ -536,59 +556,39 @@ private void InitializeComponent() this.button4.UseVisualStyleBackColor = true; this.button4.Click += new System.EventHandler(this.button4_Click); // - // NetSpeed_TextBox - // - this.NetSpeed_TextBox.Location = new System.Drawing.Point(181, 56); - this.NetSpeed_TextBox.MaxLength = 3; - this.NetSpeed_TextBox.Name = "NetSpeed_TextBox"; - this.NetSpeed_TextBox.Size = new System.Drawing.Size(65, 21); - this.NetSpeed_TextBox.TabIndex = 1; - this.NetSpeed_TextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.NetSpeed_TextBox_KeyPress); - // - // label6 + // DownloadPath_TextBox // - this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(101, 62); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(71, 12); - this.label6.TabIndex = 0; - this.label6.Text = "物理带宽(M)"; + this.DownloadPath_TextBox.Location = new System.Drawing.Point(89, 20); + this.DownloadPath_TextBox.Name = "DownloadPath_TextBox"; + this.DownloadPath_TextBox.ReadOnly = true; + this.DownloadPath_TextBox.Size = new System.Drawing.Size(259, 21); + this.DownloadPath_TextBox.TabIndex = 4; // - // Save_Button + // label5 // - this.Save_Button.Location = new System.Drawing.Point(144, 417); - this.Save_Button.Name = "Save_Button"; - this.Save_Button.Size = new System.Drawing.Size(102, 27); - this.Save_Button.TabIndex = 7; - this.Save_Button.Text = "保存"; - this.Save_Button.UseVisualStyleBackColor = true; - this.Save_Button.Click += new System.EventHandler(this.Save_Button_Click); + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(6, 24); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(77, 12); + this.label5.TabIndex = 3; + this.label5.Text = "默认下载路径"; // - // label7 + // UpdateDownLoadList_Timer // - this.label7.AutoSize = true; - this.label7.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label7.Location = new System.Drawing.Point(12, 89); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(377, 17); - this.label7.TabIndex = 2; - this.label7.Text = "说明:根据物理带宽进行下载加速,请如实填写,填写过高会加大出错风险"; + this.UpdateDownLoadList_Timer.Enabled = true; + this.UpdateDownLoadList_Timer.Interval = 1000; + this.UpdateDownLoadList_Timer.Tick += new System.EventHandler(this.UpdateDownLoadList_Timer_Tick); // - // groupBox1 + // Test_Button // - this.groupBox1.Controls.Add(this.label7); - this.groupBox1.Controls.Add(this.Save_Button); - this.groupBox1.Controls.Add(this.label6); - this.groupBox1.Controls.Add(this.NetSpeed_TextBox); - this.groupBox1.Controls.Add(this.button4); - this.groupBox1.Controls.Add(this.DownloadPath_TextBox); - this.groupBox1.Controls.Add(this.label5); - this.groupBox1.Location = new System.Drawing.Point(6, 6); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(402, 449); - this.groupBox1.TabIndex = 0; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "下载设置"; + this.Test_Button.Location = new System.Drawing.Point(488, 532); + this.Test_Button.Name = "Test_Button"; + this.Test_Button.Size = new System.Drawing.Size(75, 23); + this.Test_Button.TabIndex = 12; + this.Test_Button.Text = "Test"; + this.Test_Button.UseVisualStyleBackColor = true; + this.Test_Button.Visible = false; + this.Test_Button.Click += new System.EventHandler(this.Test_Button_Click); // // Main // diff --git a/BaiduPanDownload/Forms/Main.cs b/BaiduPanDownload/Forms/Main.cs index 3f45e88..a6bec61 100644 --- a/BaiduPanDownload/Forms/Main.cs +++ b/BaiduPanDownload/Forms/Main.cs @@ -159,6 +159,7 @@ private void 文件信息ToolStripMenuItem_Click_1(object sender, EventArgs e) MessageBox.Show( "文件名: " + info.getName() + Environment.NewLine + "文件大小: " + (getSizeGB(info.size) < 1 ? getSizeMB(info.size) + " MB" : getSizeGB(info.size) + " GB") + Environment.NewLine + + "MD5:"+info.md5+Environment.NewLine+ "文件路径: " + info.path.Replace("apps", "我的应用数据")+Environment.NewLine+ "是不是文件夹: "+(info.isdir==1?"是":"不是") ,"文件信息" @@ -247,8 +248,8 @@ void Upgraded() try { JObject job = JObject.Parse(WebTool.GetHtml("http://www.mrs4s.top/api/update.json")); - //版本8 - if ((int)job["Build"] > 8) + //版本9 + if ((int)job["Build"] > 9) { DialogResult dr = MessageBox.Show((string)job["Message"] + "\r\n\r\n是否更新?", "发现更新", MessageBoxButtons.OKCancel); if (dr == DialogResult.OK) @@ -269,7 +270,8 @@ void Upgraded() public void AddDownloadFile(DiskFileInfo info,string DownloadPath,string FileName) { - TaskManager.GetTastManager.CreateDownloadTask($"https://www.baidupcs.com/rest/2.0/pcs/stream?method=download&access_token={Program.config.Access_Token}&path=" + Uri.EscapeDataString(info.path),DownloadPath+"\\"+FileName); + //TaskManager.GetTastManager.CreateDownloadTask($"https://www.baidupcs.com/rest/2.0/pcs/stream?method=download&access_token={Program.config.Access_Token}&path=" + Uri.EscapeDataString(info.path),DownloadPath+"\\"+FileName); + TaskManager.GetTastManager.CreateDownloadTask($"https://pcs.baidu.com/rest/2.0/pcs/file?method=download&access_token={Program.config.Access_Token}&path=" + Uri.EscapeDataString(info.path), DownloadPath + "\\" + FileName); } int getDownloadTaskNum() diff --git a/BaiduPanDownload/Forms/Main.resx b/BaiduPanDownload/Forms/Main.resx index a899e88..e097a43 100644 --- a/BaiduPanDownload/Forms/Main.resx +++ b/BaiduPanDownload/Forms/Main.resx @@ -128,7 +128,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAD0 - FQAAAk1TRnQBSQFMAgEBBAEAARgBAQEYAQEBUAEAAVABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + FQAAAk1TRnQBSQFMAgEBBAEAASABAQEgAQEBUAEAAVABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAEBAgABoAMAAQEBAAEIBgAByBgAAYACAAGAAwACgAEAAYADAAGAAQABgAEAAoACAAPAAQABwAHc AcABAAHwAcoBpgEAATMFAAEzAQABMwEAATMBAAIzAgADFgEAAxwBAAMiAQADKQEAA1UBAANNAQADQgEA AzkBAAGAAXwB/wEAAlAB/wEAAZMBAAHWAQAB/wHsAcwBAAHGAdYB7wEAAdYC5wEAAZABqQGtAgAB/wEz diff --git a/BaiduPanDownload/Properties/AssemblyInfo.cs b/BaiduPanDownload/Properties/AssemblyInfo.cs index 0be9f43..9ab301c 100644 --- a/BaiduPanDownload/Properties/AssemblyInfo.cs +++ b/BaiduPanDownload/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, // 方法是按如下所示使用“*”: : // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.6.0.0")] -[assembly: AssemblyFileVersion("1.6.0.0")] +[assembly: AssemblyVersion("1.7.5.0")] +[assembly: AssemblyFileVersion("1.7.5.0")]