⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 homelog.aspx.cs

📁 its a website on property dealing made in c# and .net framework.. the database is missing though.
💻 CS
字号:
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 homelog : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button2_Click(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Response.Redirect("home.aspx");
    }
    protected void Button3_Click(object sender, EventArgs e)
    {

    }
    protected void TextBox4_TextChanged(object sender, EventArgs e)
    {

    }
    protected void LinkButton1_Click(object sender, EventArgs e)
    {

        if (TextBox1.Text == "")
        {
            Label6.Text = "  userid is missing";
        }
        else
            if (TextBox2.Text == "")
            {
                Label7.Text = "  Password is missing";
            }
            else
            {

                SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=epropertydb;Integrated Security=True");
                con.Open();
                SqlCommand cmd = new SqlCommand();
                cmd.Connection = con;
                cmd.CommandText = "select*from userdetails";
                SqlDataReader dr;
                dr = cmd.ExecuteReader();
                while (dr.Read() == true)
                {
                    if (TextBox1.Text == dr[0].ToString())
                    {
                        if (TextBox2.Text == dr[1].ToString())
                        {
                            Session["uid"] = TextBox1.Text;
                            Response.Redirect("home.aspx");

                        }
                        else
                        {
                            Label6.Text = "password error";
                        }
                    }
                    else
                    {
                        Label6.Text = "Login Error";
                    }

                }
                con.Close();

            }
    }
    protected void LinkButton2_Click(object sender, EventArgs e)
    {
        Response.Redirect("login.aspx");
    }
}

⌨️ 快捷键说明

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