ASP-based college students under the B / S model dating site

Today, the Internet has penetrated into people's daily learning, life, in all aspects, more and more people have access to information and publishing work every day on the Internet. Infinite Space has become more sophisticated computer application technology further to the Internet. On the one hand make the site more user can obtain a wealth of information and services, on the one hand but also to the people how to more easily access the content they really want is a big trouble, users increasingly demanding, hope the site can try to intelligently understand their needs and help individuals get the adaptability of information and services.

This site follows web development life cycle method and structured approach to design and implement a set of Web-based college dating site based on .NET technology. The site-based B / S (browser / server) mode, using the C # development language, select the SQLServer database. The main achievement of students dating system user management, station news management, academic management, all log management, data sharing queries, information inquiry networking, system management modules.

From the current popular database management software development point of view, for the relevant database information management site, using the .NET platform is based on Asp.net framework with C # language developed by B / S structure, using SQL SERVER in databases, and the use of ADO. NET as a bridge between the database and the program is undoubtedly the most suitable practical application of a solution. And complete the relevant operations that involve using VSTO Office documents section.

This site includes two user and administrator roles, user login system to achieve a personal information management, log management I, my photo album management, information sharing, networking information, academic exchanges, my friends and other functional modules; administrator login system implements user management system, station news management, academic management, all log management, data sharing queries, information inquiry networking, system management modules.

The main code:

if (result != null)

        {

            if (result.Tables[0].Rows.Count > 0)

            {

                Session["username"] = TextBox1.Text.ToString().Trim();

 

                if (cx.Text.ToString().Trim() == "管理员")

                {

                    Session["cx"] = result.Tables[0].Rows[0]["cx"].ToString().Trim();

                }

                else

                {

                    The Session [ " CX " ] = . Cx.Text.ToString () Trim (); 

 

                } 

 

 

                Response.Redirect ( " Main.aspx " ); 

            } 

            the else 

            { 

                Response.Write ( " <Script> JavaScript: Alert ( 'I'm sorry, the user name or password is incorrect, or your account unaudited '); </ Script>! " ); 

            } 

        } 

        the else 

        { 

            Response.Write ( " <Script> JavaScript: Alert (' Sorry, a system error, please do not unauthorized operation ! '); </ Script> " ); 

        }

 

 

   public string lb, lbtxt, sql;
    protected void Page_Load(object sender, EventArgs e)
    {
        lbtxt = Request.QueryString["lb"].ToString().Trim();
       
        if (!IsPostBack)
        {
            sql = "select content from dx where leibie='" + lbtxt + "'";
            DataSet result = new DataSet();
            result = new Class1().hsggetdata(sql);
            if (result != null)
            {
                if (result.Tables[0].Rows.Count > 0)
                {
                    content.Value  = result.Tables[0].Rows[0][0].ToString();
                }
                

            }
        }
    }

 

 

public partial class haoyou_list3 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {

            string sql;
            sql = "select * from haoyou where haoyou.username='" + Session["username"].ToString().Trim() + "' order by id desc";
            getdata(sql);
        }
    }

    private void getdata(string sql)
    {
        DataSet result = new DataSet();
        result = new Class1().hsggetdata(sql);
        if (result != null)
        {

            if (result.Tables[0].Rows.Count > 0)
            {
                DataGrid1.DataSource = result.Tables[0];
                DataGrid1.DataBind();
                Label1.Text = "以上数据中共" + result.Tables[0].Rows.Count + "";
            }
            else
            {
                DataGrid1.DataSource = null;
                DataGrid1.DataBind();
                Label1.Text = "暂无任何数据";
            }
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string sql;
        sql = "select * from haoyou where username='" + Session["username"].ToString().Trim() + "'";
        if (bh.Text.ToString().Trim() != "")
        {
            sql = sql + " and username like '%" + bh.Text.ToString().Trim() + "%'";
        }
        if (mc.Text.ToString().Trim() != "")
        {
            sql = sql + " and xm like '%" + mc.Text.ToString().Trim() + "%'";
        }

        sql = sql + " order by id desc";

        getdata(sql);
    }

    protected void DataGrid1_PageIndexChanged(object source, DataGridPageChangedEventArgs e)
    {
        string sql;
        sql = "select * from haoyou where addby='" + Session["username"].ToString().Trim() + "' order by id desc";
        getdata(sql);
        DataGrid1.CurrentPageIndex = e.NewPageIndex;
        DataGrid1.DataBind();
    }
}

 

Guess you like

Origin www.cnblogs.com/lqby/p/11568687.html