2008年3月4日 星期二

C# 判斷是否為數字

public static long checkint(string str)
{
try
{
int li_str=Convert.ToInt16(str);
}
catch
{
return -1;
}
return 1;
}

沒有留言: