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 include_Userlogin : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        if (txtName.Text.Trim().Length < 1 || txtPass.Text.Trim().Length < 1)
        {
            return;
        }
        INews shownews = new Mynews();
        SqlDataReader dr=Getmima(shownews.Myencode(txtName.Text.Trim().ToString()),shownews.Myencode(txtPass.Text.Trim().ToString()));
        if (dr.Read())
        {
            Session["Login"] = "pass";
            Response.Redirect("manage/main.aspx");
        }
    }
    //取密码
    public SqlDataReader Getmima(string sName, string sPass)
    {
        INews shownews = new Mynews();
        SqlDataReader dr = shownews.SqlGetinfo("SELECT * FROM Myuser WHERE Username='" + sName + "' AND Userpass='" + sPass + "'");
        return dr;
    }
}
