欧美色欧美亚洲高清在线观看,国产特黄特色a级在线视频,国产一区视频一区欧美,亚洲成a 人在线观看中文

  1. <ul id="fwlom"></ul>

    <object id="fwlom"></object>

    <span id="fwlom"></span><dfn id="fwlom"></dfn>

      <object id="fwlom"></object>

      asp.Net 登陸功能模塊 學(xué)習(xí)資料

      時間:2019-05-14 09:15:32下載本文作者:會員上傳
      簡介:寫寫幫文庫小編為你整理了多篇相關(guān)的《asp.Net 登陸功能模塊 學(xué)習(xí)資料》,但愿對你工作學(xué)習(xí)有幫助,當(dāng)然你在寫寫幫文庫還可以找到更多《asp.Net 登陸功能模塊 學(xué)習(xí)資料》。

      第一篇:asp.Net 登陸功能模塊 學(xué)習(xí)資料

      前臺代碼

      <%@ Page Language=“C#” AutoEventWireup=“true” CodeFile=“l(fā)ogin.aspx.cs” Inherits=“l(fā)ogin” %>

      “http://1/DTD/xhtml1-transitional.dtd”>

      無標(biāo)題頁

      用戶名:

      runat=“server”>

      ID=“RequiredFieldValidator1” runat=“server”

      ControlToValidate=“TextBox1” ErrorMessage=“用戶名不能為空

      ”>

      密碼:

      Width=“150px”>

      ID=“RequiredFieldValidator2” runat=“server”

      ControlToValidate=“TextBox2” ErrorMessage=“密碼不能為空”>

      注冊

      Web.config

      登陸按鈕后臺代碼

      protected void Button1_Click(object sender, EventArgs e)

      {

      //創(chuàng)建連接對象

      SqlConnection conn = new

      SqlConnection(ConfigurationManager.ConnectionStrings[“connection”].ConnectionString);//創(chuàng)建查詢,用戶名是否存在數(shù)據(jù)對象

      SqlCommand cmd = new SqlCommand(“select * from login where 用戶名='” + TextBox1.Text + “'”, conn);

      try

      {

      //如果存在則打開數(shù)據(jù)庫

      conn.Open();

      SqlDataReader sdr = cmd.ExecuteReader();

      //如果用戶名輸入正確

      if(sdr.Read())

      {

      //判斷密碼是否正確

      if(sdr[“密碼”].ToString()==TextBox2.Text)

      {

      //如果用戶名和密碼都正確就關(guān)閉數(shù)據(jù)庫連接

      conn.Close();

      //將用戶名存放到session中

      Session[“用戶名”] = TextBox1.Text.Trim();

      //并進入后臺頁面

      Response.Redirect(“admin_index.aspx”);

      }

      else//否則

      {

      //彈出對話框,提示密碼錯誤

      Response.Write(“”);

      }

      }

      else//否則

      {

      //彈出對話框提示用戶名錯誤

      Response.Write(“”);

      }

      }

      catch(System.Exception ee)//異常處理

      {

      Response.Write(“”);}

      finally

      {

      conn.Close();//關(guān)閉數(shù)據(jù)庫

      }

      }

      第二篇:asp.net 刪除數(shù)據(jù) 學(xué)習(xí)資料

      刪除數(shù)據(jù)

      protected void Button2_Click(object sender, EventArgs e)

      {

      SqlConnection conn = new

      SqlConnection(ConfigurationManager.ConnectionStrings[“newsConnectionString”].ConnectionString);SqlCommand cmd = new SqlCommand();

      cmd.CommandText=“delete from login where 編號='”+this.TextBox1.Text+“'”;cmd.Connection=conn;

      conn.Open();

      cmd.ExecuteNonQuery();

      conn.Close();

      Response.Write(“”);Response.Redirect(“Default.aspx”);

      }

      第三篇:asp.net 更新數(shù)據(jù) 學(xué)習(xí)資料

      更新數(shù)據(jù)

      protected void Button1_Click(object sender, EventArgs e)

      {

      SqlConnection con = new

      SqlConnection(ConfigurationManager.ConnectionStrings[“newsConnectionString”].ConnectionString);SqlCommand cmd = new SqlCommand();

      cmd.CommandText=“update login set 用戶名='”+this.TextBox2.Text+“',密碼

      ='”+this.TextBox3.Text+“',年齡='”+this.TextBox4.Text+“',性別='”+this.TextBox5.Text+“',備注='”+this.TextBox6.Text+“'where 編號=”+this.TextBox1.Text+“";

      cmd.Connection = con;

      con.Open();

      cmd.ExecuteNonQuery();

      Response.Redirect(”Default.aspx");

      con.Close();

      }

      第四篇:asp.net 添加新聞功能模塊 學(xué)習(xí)資料

      前臺代碼

      <%@ Page Language=“C#” AutoEventWireup=“true”CodeFile=“Default.aspx.cs” Inherits=“_Default” %>

      “http://1/DTD/xhtml1-transitional.dtd”>

      無標(biāo)題頁

      新聞標(biāo)題:

      Width=“523px”>

      ErrorMessage=“*”>

      新聞內(nèi)容:

      ErrorMessage=“*”>

      作者:

      ErrorMessage=“*”>

      OnClick=“Button1_Click” />

      Web.config

      提交新聞后臺代碼

      protected void Button1_Click(object sender, EventArgs e)

      {

      SqlConnection conn = new

      SqlConnection(ConfigurationManager.ConnectionStrings[“connection”].ConnectionString);

      SqlCommand insertcmd = new SqlCommand(“insert into news(新聞標(biāo)題,新聞內(nèi)容,作者)values(@新聞標(biāo)題,@新聞內(nèi)容,@作者)”, conn);

      //為每個數(shù)據(jù)庫字段設(shè)置參數(shù)

      insertcmd.Parameters.Add(“@新聞標(biāo)題”, SqlDbType.VarChar, 200);

      insertcmd.Parameters.Add(“@新聞內(nèi)容”, SqlDbType.VarChar);

      insertcmd.Parameters.Add(“@作者”, SqlDbType.VarChar, 20);

      //為每個參數(shù)賦值

      insertcmd.Parameters[“@新聞標(biāo)題”].Value = TextBox1.Text;

      insertcmd.Parameters[“@新聞內(nèi)容”].Value = TextBox2.Text;

      insertcmd.Parameters[“@作者”].Value = TextBox3.Text;

      try

      {

      conn.Open();//打開數(shù)據(jù)庫

      int flag = insertcmd.ExecuteNonQuery();//執(zhí)行添加

      if(flag > 0)//如果添加成功

      {

      Response.Write(“”);

      this.TextBox1.Text = “";

      this.TextBox2.Text = ”“;

      this.TextBox3.Text = ”“;

      }

      else// 如果添加失敗

      {

      Response.Write(”“);

      this.TextBox1.Text = ”“;

      this.TextBox2.Text = ”“;

      this.TextBox3.Text = ”“;

      }

      }

      catch(System.Exception ee)//錯誤處理

      {

      Response.Write(”");

      }

      finally

      {

      conn.Close();//關(guān)閉數(shù)據(jù)庫連接

      }

      }

      第五篇:asp.net 檢查用戶名是否存在 學(xué)習(xí)資料

      檢查用戶名是否存在功能模塊

      protected void Button1_Click(object sender, EventArgs e)

      {

      usernamevalidate();

      }

      private int usernamevalidate()

      {

      SqlConnection conn = new

      SqlConnection(ConfigurationManager.ConnectionStrings[“connection”].ConnectionString);SqlCommand selectcmd = new SqlCommand(“select * from login where 用戶名='” + TextBox1.Text.Trim()+ “'”, conn);

      int i = 0;

      try

      {

      conn.Open();

      SqlDataReader sdr = selectcmd.ExecuteReader();

      if(sdr.Read())

      {

      i = 1;

      Label1.Text = “此用戶已存在,請輸入其他用戶名!”;

      }

      else

      {

      Label1.Text = “此用戶可使用!”;

      }

      }

      catch(System.Exception ee)

      {

      Response.Write(“”);

      }

      finally

      {

      conn.Close();

      }

      return i;

      }

      下載asp.Net 登陸功能模塊 學(xué)習(xí)資料word格式文檔
      下載asp.Net 登陸功能模塊 學(xué)習(xí)資料.doc
      將本文檔下載到自己電腦,方便修改和收藏,請勿使用迅雷等下載。
      點此處下載文檔

      文檔為doc格式


      聲明:本文內(nèi)容由互聯(lián)網(wǎng)用戶自發(fā)貢獻自行上傳,本網(wǎng)站不擁有所有權(quán),未作人工編輯處理,也不承擔(dān)相關(guān)法律責(zé)任。如果您發(fā)現(xiàn)有涉嫌版權(quán)的內(nèi)容,歡迎發(fā)送郵件至:645879355@qq.com 進行舉報,并提供相關(guān)證據(jù),工作人員會在5個工作日內(nèi)聯(lián)系你,一經(jīng)查實,本站將立刻刪除涉嫌侵權(quán)內(nèi)容。

      相關(guān)范文推薦

        asp.Net 圖片上傳 學(xué)習(xí)課件

        后臺代碼 protected void Page_Load(object sender, EventArgs e){ this.Image1.Visible = false; } protected void Button1_Click(object sender, EventArgs e){ string f......

        asp.Net 站內(nèi)搜索 學(xué)習(xí)課件

        后臺代碼 protected void Button1_Click(object sender, EventArgs e){ SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["connection"].C......

        asp.net 修改密碼功能模塊 學(xué)習(xí)課件

        修改用戶后臺密碼 protected void Button1_Click(object sender, EventArgs e) { //創(chuàng)建數(shù)據(jù)庫連接對象,并調(diào)用web.config文件的連接驅(qū)動SqlConnection conn = new SqlCon......

        asp.net 頁面跳轉(zhuǎn) 學(xué)習(xí)課件(五篇模版)

        頁面跳轉(zhuǎn)public partial class Default2 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { bind; } } protected voi......

        微信企業(yè)號功能、申請、登陸說明介紹(精選5篇)

        微信企業(yè)號功能、申請、登陸說明介紹 微信企業(yè)號是什么?它有什么功能,都能用來做什么,怎么申請?在哪里登陸,本文介紹微信企業(yè)號的操作說明,幫忙大家了一個全新的微信企業(yè)平臺。......

        學(xué)習(xí)省紀(jì)委十一屆四次會議心得體會(代登陸)

        學(xué)習(xí)省紀(jì)委十一屆四次會議精神心得體會 ——衛(wèi)城鎮(zhèn)星光小學(xué) 代登陸 貴州省第十一屆紀(jì)律檢查委員會第四次全體會議,于2015年1月22日至23日在貴陽召開。中共貴州省委書記、省......

        建筑工程安全與功能檢驗資料

        安全與功能檢驗資料 一、地基與基礎(chǔ)工程 1、土工擊試驗報告 2、回填土實驗報告(應(yīng)附圖) 3、地基土承載力檢測報告 4、地基土密實度檢測報告 5、復(fù)合地基承載力檢測報告 6、工......

        學(xué)習(xí)資料

        全面推進依法治國四中全會精神解讀 法治的根本精神就是個人權(quán)利是一切國家權(quán)力的來源,憲法和國家不是公民權(quán)利的造物,而是公民權(quán)利的結(jié)果。 一、反腐是法治建設(shè)的重點指向 二......