public bool IsNumberic(string oText)
{
try
{
int var1 = Convert.ToInt32(oText);
return true;
}
catch
{
return false;
}
}
protected
void Page_Load(object sender, EventArgs e)
{
}
protected
void Button1_Click(object sender, EventArgs e)
{
string a = TextBox1.Text;
if (IsNumberic(a) == true)
{
Response.Write("输入为数值");
}
else
{
Response.Write("输入不为数值");
}
}