string id = Request.QueryString["id"]; int x; if (!int.TryParse(id, out x)) { Response.Write("输入有误!"); Response.End(); }