首页 新闻 会员 周边

初入C#,想请问下这段C# 类是什么作用?

0
[已解决问题] 解决于 2019-08-05 19:54
   private bool DoDownload(string dateTimeStr, string cid, string cName, string httpStrConfig, string type)
        {
            string[] source = httpStrConfig.Split(new char[] { ';' });
            bool flag = false;
            if (source.Count<string>() > 1)
            {
                flag = true;
                base.BeginInvoke(this.logInvoke, new object[] { $"【{cName}】有 {source.Count<string>()} 个子栏目" });
            }
            int num = 0;
            foreach (string str in from httpStr in source
                where !string.IsNullOrEmpty(httpStr)
                select httpStr)
            {
                num++;
                string str2 = flag ? $"{cName} ( {num} )" : cName;
                string str3 = str.Trim().Replace(@"\r", "").Replace(@"\n", "");
                try
                {
                    string str4 = HttpHelper.DoHttp(str3);
                    if (!string.IsNullOrEmpty(str4))
                    {
                        this.JsonStrParse(dateTimeStr, str4, cid, str2, type);
                    }
                    else
                    {
                        base.BeginInvoke(this.logInvoke, new object[] { $"[ {cid}.{str2} ] 获取信息为空" });
                    }
                }
                catch (Exception exception)
                {
                    this.WriteException(exception);
                    return false;
                }
                finally
                {
                    HttpHelper.Dispose();
                }
            }
            return true;
        }
C#
问题补充:

base.BeginInvoke(this.logInvoke, new object[] { $"【{cName}】有 {source.Count<string>()} 个子栏目" });

这段没有明白,查了好久,

阳虎为患的主页 阳虎为患 | 初学一级 | 园豆:151
提问于:2019-03-14 20:19
< >
分享
最佳答案
0
base.BeginInvoke(this.logInvoke, new object[] { $"【{cName}】有 {source.Count<string>()} 个子栏目" });

异步调用 logInvoke 方法,并给该方法传参 $"【{cName}】有 {source.Count<string>()} 个子栏目"

奖励园豆:5
dudu | 高人七级 |园豆:30994 | 2019-03-14 20:35
其他回答(1)
-1

求求你了,看点基础的吧

刘下来 | 园豆:919 (小虾三级) | 2019-03-15 08:45

人家是刚入坑

支持(0) 反对(0) 二豆 | 园豆:44 (初学一级) | 2019-03-15 09:15
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册