示例#1
0
        public static async Task <ReturnResult> StartDown(AsyncCalls async, string url)
        {
            var htmldata = (await async.CR(2001, url))?[0]?.Value <byte[]>();

            if (htmldata != null)
            {
                string html = Encoding.UTF8.GetString(htmldata);

                return(async.RET(html));
            }


            return(async.RET());// or async.RET(null);
        }
示例#2
0
        public async Task <ReturnResult> TestRec(AsyncCalls async, int count)
        {
            count--;
            if (count > 1)
            {
                var x = (await async.CR(2500, count))?[0]?.Value <int>();

                if (x != null && x.HasValue)
                {
                    count = x.Value;
                }
            }

            return(async.RET(count));
        }
示例#3
0
 public static async Task <string> MsgToUser(this AsyncCalls async, string username, string msg)
 {
     return((await async.CR((int)Cmdtype.MsgToUser, username, msg))?.First?.Value <string>());
 }
示例#4
0
 public static async Task <string> GetNick(this AsyncCalls async)
 {
     return((await async.CR((int)Cmdtype.GetNick))?.First?.Value <string>());
 }