using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//Session["time"] = DateTime.Now.Hour + "时" + DateTime.Now.Minute + "分" + DateTime.Now.Second + "秒";
//Response.Write("当前时间:" + Session["time"]);
if (Request.Cookies["use"] != null && Request.Cookies["pass"] != null)
{
if (Request.Cookies["use"].Value == "123" && Request.Cookies["pass"].Value == "123")
{
Response.Redirect("Default2.aspx?");
}
}
}
protected void Button1_Click(object sender, EventArgs e)
{
if(TextBox1.Text=="124"&&TextBox2.Text=="124"){
Response.Cookies["use"].Value = TextBox1.Text;
Response.Cookies["pass"].Value = TextBox2.Text;
Response.Cookies["use"].Expires = DateTime.Now.AddDays(1);
Response.Cookies["pass"].Expires = DateTime.Now.AddDays(1);
Response.Redirect("Default2.aspx?");
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//Session["time"] = DateTime.Now.Hour + "时" + DateTime.Now.Minute + "分" + DateTime.Now.Second + "秒";
//Response.Write("当前时间:" + Session["time"]);
if (Request.Cookies["use"] != null && Request.Cookies["pass"] != null)
{
if (Request.Cookies["use"].Value == "123" && Request.Cookies["pass"].Value == "123")
{
Response.Redirect("Default2.aspx?");
}
}
}
protected void Button1_Click(object sender, EventArgs e)
{
if(TextBox1.Text=="124"&&TextBox2.Text=="124"){
Response.Cookies["use"].Value = TextBox1.Text;
Response.Cookies["pass"].Value = TextBox2.Text;
Response.Cookies["use"].Expires = DateTime.Now.AddDays(1);
Response.Cookies["pass"].Expires = DateTime.Now.AddDays(1);
Response.Redirect("Default2.aspx?");
}
}
}