        <%ST(A)%>
		<div id="Content_ContentList" class="content-width"><a name="body" accesskey="B" href="#body"></a>
			<div class="pageContent">
					<div style="float:right;width:180px !important;width:auto">
						  <a href="feed.asp?cateID=17" target="_blank" title="订阅所有黑客的日志" accesskey="F"><img border="0" src="images/rss.png" alt="订阅所有黑客的日志" style="margin-bottom:-1px"/> 订阅</a>
						   | <a href="?id=37" title="上一篇日志: 非常经典的Ms Sql注射资料" accesskey=","><img border="0" src="images/Cprevious.gif" alt=""/>上一篇</a> | <a href="?id=39" title="下一篇日志: 清空站点目录下所有文件" accesskey="."><img border="0" src="images/Cnext.gif" alt=""/>下一篇</a>
					</div> 
						   <img src="images/icons/1.gif" style="margin:0px 2px -4px 0px" alt=""/> <strong><a href="default.asp?cateID=17" title="查看所有黑客的日志">黑客</a></strong> </div>
						   <div class="Content">
						   <div class="Content-top"><div class="ContentLeft"></div><div class="ContentRight"></div>
						     <h1 class="ContentTitle"><strong>Asp中对ip进行过滤限制函数</strong></h1>
						     <h2 class="ContentAuthor">作者:apple 日期:2006-06-09</h2>
						   </div>
						    <div class="Content-Info">
							  <div class="InfoOther">字体大小: <a href="javascript:SetFont('12px')" accesskey="1">小</a> <a href="javascript:SetFont('14px')" accesskey="2">中</a> <a href="javascript:SetFont('16px')" accesskey="3">大</a></div>
							  <div class="InfoAuthor"><img src="images/weather/hn2_sunny.gif" style="margin:0px 2px -6px 0px" alt=""/><img src="images/weather/hn2_t_sunny.gif" alt=""/> <img src="images/level3.gif" style="margin:0px 2px -1px 0px" alt=""/> 
					              <$EditAndDel$>
							  </div>
							</div>
						  <div id="logPanel" class="Content-body">
					             看了一些IP限制的函数，觉得太复杂。所以，试着写了一个，比较简单。请网友参考指教。谢谢！～<br/><br/> 程序代码<br/>&lt;%<br/>'获取访问者的地址<br/>ip=Request.ServerVariables("REMOTE_ADDR") <br/><br/>'允许的IP地址段为10.0.0.0～10.68.63.255<br/>allowip1="10.0.0.0"<br/>allowip2="10.68.10.71"<br/><br/>response.write checkip(ip,allowip1,allowip2)<br/><br/><br/>function checkip(ip,allowip1,allowip2)<br/>dim check(4)<br/>checkip=false<br/>ipstr=split(ip,".")<br/>allow1=split(allowip1,".")<br/>allow2=split(allowip2,".")<br/>if cint(allow1(0))&gt;cint(allow2(0)) then '判断IP地址段是否合法<br/>response.write "IP地址段出错！"<br/>exit function<br/>end if<br/>for i=0 to ubound(ipstr)<br/>if cint(allow1(i))&lt;cint(allow2(i)) then<br/>if cint(allow1(i))=cint(ipstr(i)) then<br/>check(i)=true<br/>checkip=true<br/>exit for<br/>else<br/>if cint(ipstr(i))&lt;cint(allow2(i)) then<br/>check(i)=true<br/>checkip=true<br/>exit for<br/>else<br/>if cint(ipstr(i))&gt;cint(allow2(i)) then<br/>check(i)=false<br/>checkip=false<br/>exit for<br/>else<br/>check(i)=true<br/>checkip=true<br/>end if<br/>end if<br/>end if<br/>else<br/>if cint(allow1(i))&gt;cint(ipstr(i)) or cint(allow1(i))&lt;cint(ipstr(i)) then<br/>check(i)=false<br/>checkip=false<br/>if i&lt;&gt;ubound(ipstr) then<br/>exit for<br/>end if<br/>else<br/>check(i)=true<br/>end if<br/>end if<br/>next<br/><br/>if (check(0)=true and check(1)=true and check(2)=true and check(3)=false) and (cint(allow2(2))&gt;cint(ipstr(2))) then<br/>checkip=true<br/>end if<br/><br/>end function<br/>%&gt;<br/>
							<br/><br/>
						   <br/>
						   </div>
						   <div class="Content-body">
					             
							<img src="images/From.gif" style="margin:0px 2px -4px 0px" alt=""/><strong>文章来自:</strong> <a href="http://www.xoofeng.com/apple/" target="_blank">本站原创</a><br/>
							<img src="images/icon_trackback.gif" style="margin:0px 2px -4px 0px" alt=""/><strong>引用通告地址:</strong> <a href="http://www.xoofeng.com/apple/trackback.asp?tbID=38" target="_blank">http://www.xoofeng.com/apple/trackback.asp?tbID=38</a><br/>
						    <img src="images/tag.gif" style="margin:4px 2px -4px 0px" alt=""/><strong>Tags:</strong> <br/>
						   </div>
						   <div class="Content-bottom"><div class="ContentBLeft"></div><div class="ContentBRight"></div>评论: 0</a> | 引用: 0 | 查看次数: <$log_ViewNums$>
			</div></div></div>
