gpt4 book ai didi

c# - 无法将类型为 'System.Single' 的对象转换为类型 'System.Int32'

转载 作者:行者123 更新时间:2023-11-30 20:23:02 24 4
gpt4 key购买 nike

<分区>

我对收到以下错误感到困惑:

Unable to cast object of type 'System.Single' to type 'System.Int32'.

我正在获取数据并按如下方式迭代它们:

public MyFault
{

public int fault_throw { get; set; }

}

protected List<MyFault> myfaults = new List<MyFault>();
foreach (var package in packages2)
{
// the following line throws an error
myfaults.Add(new MyFault {fault_throw=(int)(package["fault_throw"])});
}

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com