判断验证码出错!
我新学 的想写 登陆界面 网上找到了 图片验证码的代码那个已经正常条用但是判断验证码出错 你们看看代码吧session 和 文本框的值 都一样但是就不提示验证码正确那个提示 代码贴着了你们看看吧
程序代码:
using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; public partial class admin_Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { string xinxi = Session["ValidateCode"].ToString(); string xinxi1=TextBox3.Text; MsgBox(xinxi1); if (TextBox1.Text == "" || TextBox2.Text == "" || TextBox3.Text == "") { MsgBox("Uqur lar ni kuruk koy mang!"); } else { if (xinxi == xinxi1) { MsgBox("验证吗正确!"); } else { } } MsgBox(xinxi); } public void MsgBox(string strMsg) { string StrScript; StrScript = ("<script language=javascript>"); StrScript += ("alert('" + strMsg + "');"); StrScript += ("</script>"); System.Web.HttpContext.Current.Response.Write(StrScript); } }