1种方法:result_2 = (fuhaozu_n[j] as 你的实际类型).gailv;
2种方法:
using System.Collections;
using System.Collections.Generic;
static int kaibian(IList
result_2 = fuhaozu_n[j].gailv;
建议使用第二种方法,泛型集合,强类型,不需要类型转换
result_2 -= fuhaozu_n[j].gailv;
改成下面的语句:
//相当于 int yourInt = (int)ojbect;把object拆箱成自定义类,并实例化自定义类
自定义类 selfClassInstanse = (自定义类) fuhaozu_n[j];
result_2 -= selfClassInstanse.gailv;
造型
result_2 = (fuhaozu_n[j] as 你的实际类型).gailv
....... 你把代码贴出来啊
把object要转换为相对应的类型