long numgrade;
strValue = string.Format("{0}",numgrade).Trim();//去掉空格,有可能是前台传过来的值
if (long.TryParse(strValue, out numgrade) == false) //判断是否是数字
{
continue;
}
else
{
if (Convert.ToInt64(strValue) < 100 && Convert.ToInt64(strValue) > 1)//判断是不是1-100以内的数字
{
Int a= strValue;
}
else
{
continue;
}
}
C#判断是不是1~100以内的数字
猜你喜欢
转载自blog.csdn.net/weixin_45062076/article/details/107528573
今日推荐
周排行