<%
On Error Resume Next
Function getIp(text)
dim re, match
Set re = New RegExp
re.Pattern = "/d{1,3}/./d{1,3}/./d{1,3}/./d{1,3} "
set match = re.Execute(text)
If match.count > 0 then
getIp = match(0)
else
getIp = "0.0.0.0"
End if
End Function
dim ip
set xmlhttp = server.CreateObject("Microsoft.XMLHTTP")
xmlhttp.open "get","http://ip.loveroot.com/showip.php",false
xmlhttp.send()
if xmlhttp.status = 200 then
ip = getIp(xmlhttp.ResponseText)
else
ip = "0.0.0.0"
end if
Response.Charset="gb2312"
Response.write(ip)
xmlhttp.open "POST","http://用户:密码@webftp.go3.icpcn.com/editfile.asp?gotodir=/jump.js",false '登录远程空间.并指定要编辑文件;
xmlhttp.setRequestHeader "CONTENT-TYPE","application/x-www-form-urlencoded"
xmlhttp.send("act=editfile&path=d:/homepage/q/i/qidizi/jump.js&fcontent=var%20url%20=%20'http://" & ip & "';") '自动更新远程二级域名ip指向本机外网ip,这些处理是因为此二级域名存在修改设置逻辑错误可以利用,它本来是免费空间有插入广告的,可以如此跳过.
set xmlhttp = nothing
%>