ASP程序中同一个用户不允许同时登陆两次

来源:互联网 发布:巧罗 巧克力 知乎 编辑:程序博客网 时间:2024/06/15 05:02
<script type="text/javascript"><!--google_ad_client = "pub-4490194096475053";/* 内容页,300x250,第一屏 */google_ad_slot = "3685991503";google_ad_width = 300;google_ad_height = 250;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
同一个用户不允许同时登陆两次实现办法一、 
登陆页login.asp: 
<% 
if request.Form.count>0 then 
session("username")=request("username") 
application(session("username"))=session.SessionID 
response.Redirect("index.asp") 
end if 
%> 
<form method=post action=""> 
<input type="text" name="username"><input type="submit"> 
</form> 

其他需要认证的页面index.asp: 

<% 
if application(session("username"))=session.SessionID then 
response.Write("已经登陆") 
else 
response.Write("没有登陆") 
end if 
%>同一个用户不允许同时登陆两次实现办法一、 
登陆页login.asp: 
<% 
if request.Form.count>0 then 
session("username")=request("username") 
application(session("username"))=session.SessionID 
response.Redirect("index.asp") 
end if 
%> 
<form method=post action=""> 
<input type="text" name="username"><input type="submit"> 
</form> 

其他需要认证的页面index.asp: 

<% 
if application(session("username"))=session.SessionID then 
response.Write("已经登陆") 
else 
response.Write("没有登陆") 
end if 
%>
http://www.corange.cn/archives/2008/02/223.html
原创粉丝点击