string test = "username";
private void Page_Load(object sender, System.EventArgs e)
{
if(Application["User_" + test] == null || Application["User_" + test].ToString() != Request.UserHostAddress)
Session["login"] = null;
else
Response.Write(Session["login"].ToString() + "已登录<br>");
}
private void Button1_Click(object sender, System.EventArgs e)
{
Session["login"] = test;
Application["User_" + test] = Request.UserHostAddress;
}
实现的不让同一个用户登陆
最新推荐文章于 2021-02-16 23:39:22 发布