infopwddd.aspx.cs

来自「SQL+Asp.net(c#)网上考试系统」· CS 代码 · 共 31 行

CS
31
字号
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class InfoPwddd : System.Web.UI.Page
{
    Datacon dataconn = new Datacon();
    protected void Page_Load(object sender, EventArgs e)
    {
        SqlConnection con = dataconn.getcon();
        con.Open();
        SqlCommand mycom1 = new SqlCommand("select ID,Pwd from tb_Student where ID='" + Convert.ToString(Session["ID"]) + "'", con);
        SqlCommand mycom2 = new SqlCommand("select PWD from tb_Student where ID='" + Convert.ToString(Session["ID"]) + "'", con);
        this.txtStuID.Text = Convert.ToString(mycom1.ExecuteScalar());
        this.txtStuPwd.Text = Convert.ToString(mycom2.ExecuteScalar());
        con.Close();
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Page.Response.Redirect("Default.aspx");
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?