把string转化为int类型,不成功则返回0
摘要:/// <summary> /// 将字符串数据转换为int数据,如果格式不对则返回0 /// </summary> /// <param name="str">需要转换的字符串</param> /// <returns></returns> public static int String2Int
阅读全文
posted @
2024-03-14 14:49
阿霖找BUG
阅读(88)
推荐(0) 编辑
C#try捕捉不了NullReferenceException
摘要:用debug运行以下代码出现空指针错误 double[] EnergyScaleValue = new double[3]; try { EnergyScaleValue = null; } catch (NullReferenceException ee) { MessageBox.Show("请
阅读全文
posted @
2024-03-14 14:47
阿霖找BUG
阅读(74)
推荐(0) 编辑