//可空类型 Nullable<int> a = null; int? a2 = null; int ?b =123; if(b.HasValue)//判断是否有值 {//通过value获取值 int b2 = b.Value; Console.WriteLine(b2); }