public AddDownload(Main main, BaiduPanDownload.Data.DiskFileInfo info, bool URLMode = false, string Url = "")
 {
     InitializeComponent();
     this.main    = main;
     this.info    = info;
     this.URLMode = URLMode;
     this.Url     = Url;
 }
        public DiskFileInfo[] getFileList()
        {
            if (isdir != 1)
            {
                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=" + Uri.EscapeDataString(path)));

            foreach (JObject job in jobj["list"])
            {
                DiskFileInfo fileinfo = JsonConvert.DeserializeObject <BaiduPanDownload.Data.DiskFileInfo>(job.ToString());
                if (fileinfo.isdir == 1)
                {
                    foreach (DiskFileInfo info in fileinfo.getFileList())
                    {
                        FileList.Add(info);
                    }
                    continue;
                }
                FileList.Add(fileinfo);
            }
            return((DiskFileInfo[])FileList.ToArray(typeof(DiskFileInfo)));
        }
Beispiel #3
0
 public AddDownload(Main main, BaiduPanDownload.Data.DiskFileInfo info)
 {
     InitializeComponent();
     this.main = main;
     this.info = info;
 }