Esempio n. 1
0
        /// <summary>
        /// 返回由gid(字符串)表示的下载文件列表
        /// </summary>
        /// <param name="gid"></param>
        /// <returns></returns>
        public static async Task <string> GetFiles(string gid)
        {
            string str  = "";
            var    json = new JsonClass();

            json.Jsonrpc = "2.0";
            json.Id      = "qwer";
            json.Method  = "aria2.getFiles";
            List <string> paramslist = new List <string>();

            //添加下载地址
            paramslist.Add(gid);
            json.Params = paramslist;
            str         = await Aria2.SendAndReceive(json);

            return(str);
        }
Esempio n. 2
0
        /// <summary>
        /// 把全部在下载的任务状态改为等待下载
        /// </summary>
        /// <param name="gid"></param>
        /// <returns></returns>
        public static async Task <string> PauseToWaitingAll()
        {
            string str  = "";
            var    json = new JsonClass();

            json.Jsonrpc = "2.0";
            json.Id      = "qwer";
            json.Method  = "aria2.unpauseAll";
            List <string> paramslist = new List <string>();

            //添加下载地址
            paramslist.Add("");
            json.Params = paramslist;
            str         = await Aria2.SendAndReceive(json);

            return(str);
        }
Esempio n. 3
0
        /// <summary>
        /// 返回下载进度
        /// </summary>
        /// <param name="gid"></param>
        /// <returns></returns>
        public static async Task <string> TellStatus(string gid)
        {
            string str  = "";
            var    json = new JsonClass();

            json.Jsonrpc = "2.0";
            json.Id      = "qwer";
            json.Method  = "aria2.tellStatus";
            List <string> paramslist = new List <string>();

            //添加下载地址
            paramslist.Add(gid);
            paramslist.Add("completedLength\", \"totalLength\",\"downloadSpeed");

            json.Params = paramslist;
            str         = await Aria2.SendAndReceive(json);

            return(str);
        }