谁能帮我把这段php码译成asp的,要详细哦

来源:百度知道 编辑:UC知道 时间:2024/07/12 15:00:38
<?php
function PA_CheckPageAccess(){
$A_strAllowIP = Array("127.0.0.1", "192.168.0.2");
$A_strAllowDomain = Array("10.0.0", "192.168.0");
$m_strIP = $GLOBALS["HTTP_SERVER_VARS"]["REMOTE_ADDR"];
$m_strIP_domain = substr($m_strIP, 0, strrpos($m_strIP, ".") );
for($i=0; $i<count($A_strAllowIP); $i++) {
if($strIP==$A_strAllowIP[$i]) {
return true;
}
}
for($i=0; $i<count($A_strAllowDomain); $i++) {
if($m_strIP_domain==$A_strAllowDomain[$i]) {
return true;
}
}
return false;
}

if( !PA_CheckPageAccess() ){
echo "No Access. (你不能访问)";
exit;
}
?>
if PA_CheckPageAccess()=false then response.write "No Access. (你不能访问)"
换成
if PA_CheckPageAccess()=false then response.redir

<%
function PA_CheckPageAccess()
A_strAllowIP = Array("127.0.0.1", "192.168.0.2")
A_strAllowDomain = Array("10.0.0", "192.168.0")
m_strIP = Request.ServerVariables("Remote_Addr")

m_strIP_domain = mid(m_strIP, 1, InStrRev(m_strIP, ".")-1 )
PA_CheckPageAccess= false

for i=0 to Ubound(A_strAllowIP)
if m_strIP=A_strAllowIP(i) then
PA_CheckPageAccess=true
exit function
end if
next

for i=0 to Ubound(A_strAllowDomain)
if m_strIP_domain=A_strAllowDomain(i) then
PA_CheckPageAccess= true
exit function
end if
next

}
end function

if PA_CheckPageAccess()=false then response.write "No Access. (你不能访问)"

%>

原代码的
if($strIP==$A_strAllowIP[$i]) { 似乎有错

应该是:
if($m_strIP==$A_strAllowIP[$i]) {

我来```