Skip to content
This repository has been archived by the owner on May 31, 2021. It is now read-only.

Commit

Permalink
修复了下载速度不稳定等bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrs4s committed Nov 22, 2016
1 parent 606c09c commit 8e7df9c
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 87 deletions.
2 changes: 1 addition & 1 deletion BaiduPanDownload/Data/DiskFileInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<BaiduPanDownload.Data.DiskFileInfo>(job.ToString());
Expand Down
160 changes: 80 additions & 80 deletions BaiduPanDownload/Forms/Main.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions BaiduPanDownload/Forms/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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?"是":"不是")
,"文件信息"
Expand Down Expand Up @@ -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)
Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion BaiduPanDownload/Forms/Main.resx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAD0
FQAAAk1TRnQBSQFMAgEBBAEAARgBAQEYAQEBUAEAAVABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
FQAAAk1TRnQBSQFMAgEBBAEAASABAQEgAQEBUAEAAVABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAEBAgABoAMAAQEBAAEIBgAByBgAAYACAAGAAwACgAEAAYADAAGAAQABgAEAAoACAAPAAQABwAHc
AcABAAHwAcoBpgEAATMFAAEzAQABMwEAATMBAAIzAgADFgEAAxwBAAMiAQADKQEAA1UBAANNAQADQgEA
AzkBAAGAAXwB/wEAAlAB/wEAAZMBAAHWAQAB/wHsAcwBAAHGAdYB7wEAAdYC5wEAAZABqQGtAgAB/wEz
Expand Down
4 changes: 2 additions & 2 deletions BaiduPanDownload/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]

0 comments on commit 8e7df9c

Please sign in to comment.