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;
}
这段没有明白,查了好久,
base.BeginInvoke(this.logInvoke, new object[] { $"【{cName}】有 {source.Count<string>()} 个子栏目" });
异步调用 logInvoke
方法,并给该方法传参 $"【{cName}】有 {source.Count<string>()} 个子栏目"
求求你了,看点基础的吧
人家是刚入坑