long a = (long)item[1];//报错
long a = (int)item[1];//OK
下面是报错的信息。
System.InvalidCastException:“Unable to cast object of type 'System.Int32' to type 'System.Int64'.”
我很奇怪,为什么只能转Int??
...全文
273433打赏收藏
见鬼了。int 不能转long
item[1]是object类型 是个整数8 long a = (long)item[1];//报错 long a = (int)item[1];//OK 下面是报错的信息。 System.InvalidCastException:“Unable to cast object of type 'System.Int32' to type 'System.Int64'.” 我很奇怪,为什么只能转Int??