Example #1
0
        /// <summary>
        /// 获取全局下载速度
        /// </summary>
        public async void GetGlobalStatus()
        {
            while (true)
            {
                // 查询全局status
                var globalStatus = await AriaClient.GetGlobalStatAsync();

                if (globalStatus == null || globalStatus.Result == null)
                {
                    continue;
                }

                long globalSpeed = long.Parse(globalStatus.Result.DownloadSpeed);
                // 回调
                OnGlobalStatus(globalSpeed);

                // 降低CPU占用
                Thread.Sleep(100);
            }
        }