Students based dating sites in the B / S mode

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 .NET-based Web-based technical university students dating site . 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.

 

protected void Button1_Click(object sender, EventArgs e)
    {
        if (TextBox2.Text.ToString().Trim() == "" || TextBox1.Text.ToString().Trim() == "" || yzm.Text.ToString().Trim() == "")
        {
            Response.Write("<script>javascript:alert('请输入完整');location.href='login.aspx';</script>");
            Response.End();
        }
        if (Session["code"].ToString().Trim().Equals(yzm.Text.Trim()))
        {

        }
        else
        {
            Response.Write("<script>javascript:alert('验证码有误');location.href='login.aspx';</script>");
            Response.End();
        }
        string sql = "";
        if (cx.Text.ToString().Trim() == "管理员")
        {
            sql = "select * from allusers where username='" + TextBox1.Text.ToString().Trim() + "' and pwd='" + TextBox2.Text.ToString().Trim() + "' ";
        }
     
                if (cx.Text.ToString (). Trim () == administrator"" ) 
                { 
                    The Session [ " CX " ] = result.Tables [ 0 ] .Rows [ 0 ] [ " CX " ] .ToString () Trim ();. 
                } 
                The else 
                { 
                    the Session [ " CX " ] = cx.Text.ToString () .trim (); 

                } 

                Response.Redirect ( " Main.aspx " ); 
            } 
            the else
            {
                Response.Write ( " <Script> JavaScript: Alert ( 'Sorry, a user name or password is incorrect, or your account unaudited!'); </ Script> " ); 
            } 
        }

 

 

IIF (TextBox1.Text.ToString (). Trim () == "" || TextBox2.Text.ToString (). Trim () == "" || TextBox3.Text.ToString (). Trim () == " " ) 
        { 
            Response.Write ( " <Script> JavaScript: Alert ( 'Please complete'); history.back (); </ Script> " ); 
        } 
        the else 
        { 
            IF (TextBox2.Text.ToString () Trim (. !) = TextBox3.Text.ToString () Trim ()). 
            { 
                Response.Write ( " <Script> JavaScript: Alert ( 'two different passwords to, make sure'); history.back (); < / script> " );
            }
            else
            {
                string sql;
                sql = "select * from allusers where username='" + Session["username"].ToString().Trim() + "' and pwd='" + TextBox1.Text.ToString().Trim() + "'";

                DataSet result = new DataSet();
                result = new Class1().hsggetdata(sql);
                if (result != null)
                {
                    if (result.Tables[0].Rows.Count > 0)
                    {
                        sql = "update allusers set pwd='" + TextBox2.Text.ToString().Trim() + "' where username='" + Session["username"].ToString().Trim() + "'";
                        int result2;
                        result2 = new Class1().hsgexucute(sql);
                        if (result2 == 1)
                        {
                            Response.Write("<script> javascript: alert ( 'successfully modified'); </ Script> " ); 
                        } 
                        the else 
                        { 
                            Response.Write ( " <script> javascript: alert ( 'System Error'); </ Script> " ); 
                        } 
                    } 
                    the else 
                    { 
                        Response.Write ( " <Script> JavaScript: Alert ( 'old password is incorrect'); </ Script> " ); 
                    } 
                }

 

Guess you like

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