资源简介

.net期末大作业,本人自己做的,网上除了此处别无他处可下,ASP动态网站,有数据库完整代码,可直接交!

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Configuration;
using System.Data.SqlClient;
using System.Data;
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender EventArgs e)
    {

    }
    public static string getConnStr()
    {
        return WebConfigurationManager.ConnectionStrings[“login“].ToString();
    }
  

    protected void Button1_Click1(object sender EventArgs e)
    {
        string str = getConnStr();
        SqlConnection myconn = new SqlConnection();
        myconn.ConnectionString = str;
        myconn.Open();
        string sqlstr = “select usernamepassword from login where username=‘“ + TextBox1.Text + “‘and password=‘“ + TextBox2.Text + “‘“;
        SqlCommand mycmd = new SqlCommand(sqlstr myconn);
        SqlDataReader Sunda = mycmd.ExecuteReader();
        if (Sunda.Read())
        {
            if (TextBox1.Text == “张凯“ & TextBox2.Text == “123456“)
            {
                Response.Redirect(“~/manage/manage1.aspx“);
            }
            else
            {
                
                Session[“ID“] = TextBox1.Text;
                Session[“PW“] = TextBox2.Text;
                Response.Redirect(“~/business/business1.aspx“);
            }
        }
        else
        {
            Response.Write(“ript>alert(‘账号或密码错误!‘)ript>“);
        }
        myconn.Close();
    }
    protected void Button2_Click(object sender EventArgs e)
    {
        Response.Redirect(“~/register/register.aspx“);
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2011-06-19 20:05  091114052张凯\
     目录           0  2011-06-17 22:08  091114052张凯\Myweb\
     目录           0  2011-06-17 22:08  091114052张凯\Myweb\business\
     文件        2257  2011-06-16 00:52  091114052张凯\Myweb\business\business.aspx
     文件         408  2011-06-16 00:52  091114052张凯\Myweb\business\business.aspx.cs
     文件        9691  2011-06-17 21:58  091114052张凯\Myweb\business\business1.aspx
     文件        5505  2011-06-17 21:39  091114052张凯\Myweb\business\business1.aspx.cs
     文件        5573  2011-06-17 21:59  091114052张凯\Myweb\business\business2.aspx
     文件        1313  2011-06-16 00:56  091114052张凯\Myweb\business\business2.aspx.cs
     文件        7106  2011-06-12 09:31  091114052张凯\Myweb\business\business3.aspx
     文件        1980  2011-06-12 09:30  091114052张凯\Myweb\business\business3.aspx.cs
     目录           0  2011-06-17 22:08  091114052张凯\Myweb\data\
     文件     3145728  2011-06-13 10:39  091114052张凯\Myweb\data\login.mdf
     文件     1048576  2011-06-13 10:39  091114052张凯\Myweb\data\login_log.ldf
     目录           0  2011-06-17 22:08  091114052张凯\Myweb\images\
     文件       53363  2011-06-10 18:39  091114052张凯\Myweb\images\login.jpg
     文件        2540  2011-06-13 10:59  091114052张凯\Myweb\login.aspx
     文件        1697  2011-06-11 22:28  091114052张凯\Myweb\login.aspx.cs
     目录           0  2011-06-17 22:08  091114052张凯\Myweb\manage\
     文件        3125  2011-06-15 20:56  091114052张凯\Myweb\manage\assistant.aspx
     文件         406  2011-06-12 18:07  091114052张凯\Myweb\manage\assistant.aspx.cs
     文件        2219  2011-06-12 18:08  091114052张凯\Myweb\manage\manage.aspx
     文件         406  2011-06-12 18:07  091114052张凯\Myweb\manage\manage.aspx.cs
     文件        4711  2011-06-15 20:54  091114052张凯\Myweb\manage\manage1.aspx
     文件        1716  2011-06-15 20:54  091114052张凯\Myweb\manage\manage1.aspx.cs
     文件        4403  2011-06-12 18:03  091114052张凯\Myweb\manage\manage2.aspx
     文件        1670  2011-06-12 18:04  091114052张凯\Myweb\manage\manage2.aspx.cs
     文件        4801  2011-06-12 18:04  091114052张凯\Myweb\manage\manage3.aspx
     文件        1687  2011-06-12 18:04  091114052张凯\Myweb\manage\manage3.aspx.cs
     文件        5427  2011-06-12 01:17  091114052张凯\Myweb\manage\manage4.aspx
     文件        1574  2011-06-12 01:18  091114052张凯\Myweb\manage\manage4.aspx.cs
............此处省略8个文件信息

评论

共有 条评论