/// <summary>
        /// 获取下载任务的文件信息
        /// </summary>
        /// <param name="gid">任务标识符</param>
        /// <returns>成功返回文件信息列表,失败返回空</returns>
        public static List <Aria2cFile> GetFiles(string gid)
        {
            XmlRpcStruct[]    xmlstruct = aria2c.GetFiles(Aria2cRpcSecret, gid);
            List <Aria2cFile> files     = Aria2cTools.ConvertToAria2cFiles(xmlstruct);

            return(files);
        }
        /// <summary>
        /// 将RPC信息转换为下载任务
        /// </summary>
        /// <param name="rpcStruct">RPC信息</param>
        public Aria2cTask(XmlRpcStruct rpcStruct)
        {
            List <string> keyList   = rpcStruct.Keys as List <string>;
            List <object> valueList = rpcStruct.Values as List <object>;

            for (int i = 0; i < rpcStruct.Count; i++)
            {
                string key   = keyList[i];
                object value = valueList[i];

                if (key == "gid")
                {
                    this.Gid = value as string;
                }
                else if (key == "status")
                {
                    this.Status = ConvertToAria2cTaskStatus(value as string);
                }
                else if (key == "totalLength")
                {
                    this.TotalLength = Convert.ToInt64(value as string);
                }
                else if (key == "completedLength")
                {
                    this.CompletedLength = Convert.ToInt64(value as string);
                }
                else if (key == "uploadLength")
                {
                    this.UploadLength = Convert.ToInt64(value as string);
                }
                else if (key == "bitfield")
                {
                    this.Bitfield = value as string;
                }
                else if (key == "downloadSpeed")
                {
                    this.DownloadSpeed = Convert.ToInt64(value as string);
                }
                else if (key == "uploadSpeed")
                {
                    this.UploadSpeed = Convert.ToInt64(value as string);
                }
                else if (key == "infoHash")
                {
                    this.InfoHash = value as string;
                }
                else if (key == "numSeeders")
                {
                    this.NumSeeders = Convert.ToInt64(value as string);
                }
                else if (key == "numPieces")
                {
                    this.NumPieces = Convert.ToInt64(value as string);
                }
                else if (key == "seeder")
                {
                    this.Seeder = (value as string) == "true" ? true : false;
                }
                else if (key == "pieceLength")
                {
                    this.PieceLength = Convert.ToInt64(value as string);
                }
                else if (key == "connections")
                {
                    this.Connections = Convert.ToInt64(value as string);
                }
                else if (key == "errorCode")
                {
                    this.ErrorCode = Convert.ToInt64(value as string);
                }
                else if (key == "errorMessage")
                {
                    this.ErrorMessage = value as string;
                }
                else if (key == "followedBy")
                {
                    this.FollowedBy = value;
                }
                else if (key == "following")
                {
                    this.Following = value;
                }
                else if (key == "belongsTo")
                {
                    this.BelongsTo = value as string;
                }
                else if (key == "dir")
                {
                    this.Dir = value as string;
                }
                else if (key == "files")
                {
                    this.Files = Aria2cTools.ConvertToAria2cFiles(value as XmlRpcStruct[]);
                }
                else if (key == "bittorrent")
                {
                    this.Bittorrent = new Aria2cBittorrent(value as XmlRpcStruct);
                }
                else if (key == "verifiedLength")
                {
                    this.VerifiedLength = Convert.ToInt64(value as string);
                }
                else if (key == "verifyIntegrityPending")
                {
                    this.VerifyIntegrityPending = (value as string) == "true" ? true : false;
                }
                else
                {
                    throw new Exception("Aria2cTask不包含该属性");
                }
            }
        }