<%
Dim hostname
hostname=Request.ServerVariables("SERVER_NAME")
hostname=Replace(hostname,"www.","") '去掉前面的www
if Instr(hostname,"ip00.cn")<2 then '判斷域名中包含xxx.com則正常顯示網站,否則其他域名均顯示以下文字提示
response.write "必須是二級域名才可以" '防止aspbc.com這個域名進入
Response.end
end if
username=Split(hostname,".")(0) '得到用戶名
username=Replace(Replace(username,"'",""),";","") '過濾掉單引號和分號
%>
二級域名:<%=hostname%>
會員賬號:<%=username%>