欢迎您访问我爱IT技术网,今天小编为你分享的编程技术是:【用ASP对网页进行简单的保护】,下面是详细的分享!
用ASP对网页进行简单的保护
<html>
<head>
<meta http-equiv=“Content-Type” content=“text/html; charset=gb_2312-80”>
<meta name=“GENERATOR” content=“Microsoft FrontPage Express 2.0”>
<style>
<!--
.as{ line-height: 15px; font-size: 9pt }
a:hover {color: rgb(0,51,240);text-decoration:underline}
.p9 { font-family: “宋体”; font-size: 9pt; line-height: 15pt}
.p12 { font-family: “宋体”; font-size: 12pt; line-height: 18pt}
a:link { text-decoration: none;}
a:visited { text-decoration:none;}
a:hover {text-decoration: underline;font-size: 125%;color:blue}
-->
</style>
<title>ASP页面防火墙功能演示</title>
</head>
<body background=“back.jpg”>
<%
′使用Request.ServerVariables(“REMOTE_ADDR”)得到IP地址并保存在变量rip中
rip=Request.ServerVariables(“REMOTE_ADDR”)
strip=cstr(rip)
′取得IP地址第三个段的值并保存到strip中
for i=1 to 2
strip=right(strip,len(strip)-instr(1,strip,“.”))
next
strip=left(strip,instr(1,strip,“.”)-1)
′IP地址有效性检验及密码验证,包括两方面的内容:
′如果IP地址符合则通过验证;如果IP地址不符合则检验输入的密码是否正确(此处密码为“asp”)
if (left(rip,5) <> “127.1” or strip<“1” or strip>“50”) and request(“Passwd”)<>“asp” then
%>
<p><font color=“#FF0000”>对不起,你的IP是<%=rip%>,本页面可以访问的IP是127.1.1.*到127.1.50.*之间,如果你是本单位内部网的用户,请确认你的浏览器没有使用代理!<BR></font></p>
<form action=“demo.asp” method=“POST” id=form1 name=form1>
<p>请输入访问密码:<input type=“password” name=“Passwd” > <input type=“submit” value=“确认” name=“B1”>;
</p>
</form>
<%else %>
′合法用户可以访问的页面,在此可以加入任何信息
祝贺您,您已经顺利通过了页面的安全认证,可以直接使用本站点的资源!
<%end if%>
</body>
</html>
以上所分享的是关于用ASP对网页进行简单的保护,下面是编辑为你推荐的有价值的用户互动:
相关问题:想用ASP做一个简单的英语能力测试网页,然后将答题...
答:如果没有基础的话,建议你在附件的基础上改下就好,如果只是选择题的话是很容易实现的,可以自动评分。 >>详细
相关问题:求一个简单的ASP动态网页 交作业用 越简单越好 直...
答:给你一个,就一个文件,是个留言本,很简单的。 >>详细
相关问题:ASP实现简单的网页保护
答:<html> <head> <meta http-equiv=“Content-Type” content=“text/html; charset=gb_2312-80”> <meta name=“GENERATOR” content=“Microsoft FrontPage Express 2.0”> <style> <!-- .as{ line-height: 15px; font-size: 9pt } a:... >>详细
- 评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
-
