主要使用request对象的ServerVariables属性,通过它来获得环境变量的值。使用的语法为:Request.ServerVariables(variable),“variable”表示环境变量的名称,如服务器主机名称、Web服务器软件名等等,若“variable”为“REMOTE_ADDR”则表示访问者的IP地址,通过它就可以实现IP地址的过滤。
源程序如下:(文件名:demo.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>