各位大哥,这段程序点击确定没有任何反应,求教!!!!!!!!!谢谢!!!

来源:互联网 发布:淘宝商城登陆 编辑:程序博客网 时间:2024/05/16 19:51

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;

namespace gongshu
{
 /// <summary>
 /// Login 的摘要说明。
 /// </summary>
 public class Login : System.Web.UI.Page
 {
  protected System.Web.UI.WebControls.TextBox TB_No;
  protected System.Web.UI.WebControls.Button BT_Submit;
  protected System.Web.UI.WebControls.Button BT_Cancel;
  protected System.Web.UI.WebControls.TextBox TB_Pass;
 
  private void Page_Load(object sender, System.EventArgs e)
  {
   Response.Write("fsdjgfusdgf");
   // 在此处放置用户代码以初始化页面
  }

  #region Web 窗体设计器生成的代码
  override protected void OnInit(EventArgs e)
  {
   //
   // CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
   //
   InitializeComponent();
   base.OnInit(e);
  }
  
  /// <summary>
  /// 设计器支持所需的方法 - 不要使用代码编辑器修改
  /// 此方法的内容。
  /// </summary>
  private void InitializeComponent()
  {   
   this.BT_Submit.Click += new System.EventHandler(this.BT_Submit_Click);
   this.Load += new System.EventHandler(this.Page_Load);

  }
  #endregion

  private void BT_Submit_Click(object sender, System.EventArgs e)
  {
   Page.Response.Write("fsdjgfusdgf");
            string strconn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath("./")+"table.mdb";
   OleDbConnection conn=new OleDbConnection(strconn);
//   OleDbConnection conn=new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath("./")+"table.mdb;");
   string selectstr="select No from Use where No='"+TB_No.Text+"' and Password='"+TB_Pass.Text+"'";
   OleDbCommand mycommand=new OleDbCommand(selectstr,conn);
   Page.Response.Write(selectstr);
   
   OleDbDataReader dr;
   conn.Open();
   TB_No.Text="123";
   dr=mycommand.ExecuteReader();
   while(dr.Read())
   {
    Session["No"]=TB_No.Text;
    Response.Redirect("Aframe.htm");
   }
   
    TB_No.Text="123";
    TB_Pass.Text="";
   
 }
 }
}

原创粉丝点击