1/// <summary>
2/// 判断是否是数字
3/// </summary>
4/// <param name="str">字符串</param>
5/// <returns></returns>
6private bool IsNumeric(string str)
7{
8if (str == null || str.Length == 0)
9return false;
10System.Text.ASCIIEncoding ascii = new System.Text.ASCIIEncoding();
11byte[] bytestr = ascii.GetBytes(str);
12foreach (byte c in bytestr)
13{
14if (c < 48 || c > 57)
15{
16return false;
17}
18}
19return true;
20}
21
2/// 判断是否是数字
3/// </summary>
4/// <param name="str">字符串</param>
5/// <returns></returns>
6private bool IsNumeric(string str)
7{
8if (str == null || str.Length == 0)
9return false;
10System.Text.ASCIIEncoding ascii = new System.Text.ASCIIEncoding();
11byte[] bytestr = ascii.GetBytes(str);
12foreach (byte c in bytestr)
13{
14if (c < 48 || c > 57)
15{
16return false;
17}
18}
19return true;
20}
21