|
Server : Microsoft-IIS/10.0 System : Windows NT EBS-6136 10.0 build 17763 (Windows Server 2016) i586 User : jxgj ( 0) PHP Version : 7.0.33 Disable Function : passthru,exec,system,shell_exec,proc_open,popen,pcntl_exec,socket_bind,stream_socket_server Directory : D:/tmp_aspnet/root/712bd9e6/ca967f19/ |
?#pragma checksum "D:\wwwroot\bgsciences\wwwroot\sysmanage\login.aspx.cs" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "7A64DFA72C4157ACC1D7172CBDF1F3529D234C8E"
#line 1 "D:\wwwroot\bgsciences\wwwroot\sysmanage\login.aspx.cs"
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
public partial class sysmanage_login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ClientScript.RegisterStartupScript(this.GetType(), "onload", "<script language='javascript'>setfocus()</script>");
}
}
protected void bt_login_Click(object sender, EventArgs e)
{
try
{
//if (Session["code"].ToString() == this.chknumber.Value.ToUpper().Trim())
//{
string name = this.user.Value.Trim();
string pwd = FormsAuthentication.HashPasswordForStoringInConfigFile(this.pwd.Value.Trim(), "MD5");
string strWhere = string.Format(" select *,(select coulums from S_Authorization where id = S_Users.groupid) as colcount from S_Users where username='{0}' and passwords='{1}'", name, pwd);
DataTable dt = SQLServerHelper.ExecuteTable(strWhere);
if (dt.Rows.Count > 0)
{
Session["UserID"] = dt.Rows[0]["id"];
Session["UserName"] = dt.Rows[0]["username"];
Session["leftcoulum"] = dt.Rows[0]["colcount"]; //左侧栏目权限
Session["managetype"] = dt.Rows[0]["ismanage"]; //用户权限,治理用户为1 占有高级治理栏目权限,通常用户为0 没有高级治理栏目权限
Session.Timeout = 60;
HttpCookie cook = new HttpCookie("UserName", dt.Rows[0]["username"].ToString());
cook.Expires.AddDays(1); // cookies 1 天
Response.SetCookie(cook);
HttpCookie cook2 = new HttpCookie("UserID", dt.Rows[0]["id"].ToString());
cook2.Expires.AddDays(1); // cookies 1 天
Response.SetCookie(cook2);
HttpCookie cook3 = new HttpCookie("leftcoulum", dt.Rows[0]["colcount"].ToString());
cook3.Expires.AddDays(1); // cookies 1 天
Response.SetCookie(cook3);
Response.Redirect("index.html");
}
else
{
MessageBox.Show(this, "用户名或密码谬误");
return;
}
//}
//else
//{
// MessageBox.Show(this, "验证码谬误");
// return;
//}
}
catch (Exception ex)
{
}
}
}
#line default
#line hidden