/**//// <summary> ///检查字符串,看有没有非发字符不允许输入已|分割 /// </summary> public static void check_str(string str) ...{ string Illegal_Str = ",|&|+|'|"|or|"; string[] newstr = Illegal_Str.Split('|'); for (int i = 0; i < (newstr.Length - 1); i++) ...{ if (str.IndexOf(newstr[i]) != -1) ...{ System.Web.HttpContext.Current.Response.Write("<script>alert('含有非法字符!');history.back()</script>"); } } }