.NET ez 2011-11-28
可以用來判斷用戶是否輸入錯數值!
/// <summary> /// 判斷是否為數字 /// </summary> public static bool IsNumeric(object obj) { double retNum; bool Result = Double.TryParse(obj.ToString(), System.Globalization.NumberStyles.Any , System.Globalization.NumberFormatInfo.InvariantInfo, out retNum); return Result; }
標籤: .NET