我正在尝试转换从 API 中提取的列表并将其转换为列表。该列表确实返回了其他数据,但我有代码在那里只返回我想要的数据(它可能是错误的)
//this pulls the data
public List<AccountBalance> CorpAccounts(int CORP_KEY, string CORP_API, int USER)
{
List<AccountBalance> _CAccount = new List<AccountBalance>();
EveApi api = new EveApi(CORP_KEY, CORP_API, USER);
List<AccountBalance> caccount = api.GetCorporationAccountBalance();
foreach (var line in caccount)
{
//everyting after
string apiString = line.ToString();
string[] tokens = apiString.Split(' ');
_CAccount.Add(line);
}
return _CAccount;
}
//I am trying to convert the list to the array here
private void docorpaccounts()
{
string[] corpbal = cwaa.CorpAccounts(CORP_KEY, CORP_API, USER).ToArray();
}
使用该代码,我收到此错误:
错误 1 无法将类型“EveAI.Live.AccountBalance[]”隐式转换为“string[]”
不知道我在这里做错了什么。