1、asp 獲取來路url 再根據參數轉到指定的域名的頁面如何做?
<%
url=Request.ServerVariables("SERVER_NAME")if url ="www.aaa.com" then
response.redirect "1.asp"
elseif yuming = "www.bbb.com" then
response.redirect "2.asp"end if%>
2、如何利用ASP獲取來路網址的域名
代碼如下
<%
dim Url
if Request.ServerVariables("HTTP_REFERER")<>"" then
Url=Request.ServerVariables("HTTP_REFERER")
else
Url="獲取來路失敗版"
end if
%>
來路域名權:<%=Url%>
3、asp怎麼得到本域名內的asp頁面源代碼?
使用xmlhttp獲取
4、asp如何獲取域名前綴
<%
str = "http://bbs.abc.com"
str2 = split(str,".")
result = replace(str2(0),"http://","")
response.write result
%>
5、【求助】求一段ASP獲取當前域名(去www.)的代碼
我是QQ上的清風,已為你解決問題。
6、高手進:asp如何獲取域名對應的IP。
asp下有三個方法可以實現:
1.使用wscript.shell運行ping或者nslookup命令獲取已知域名的伺服器的IP。
代碼:
<form method="post">
<input type=text name="name" size=60>
<input type=submit value="run"></form>
<%if request("name")<>"" then response.write server.createobject("wscript.shell").exec(server.mappath("nslookup.exe")&" "&request.form
("name")).stdout.readall%>
雖然wscript.shell組件可用。上面的代碼剛開始在我電腦上測試時通過不過。將c:\windows\system32下nslookup復制到asp文件的目錄下,可以了。
2.也是剛查到的。使用組件。
TCPIP.DNS組件
相關信息你百度一下
3.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%Stime=Timer()%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>asp 通過域名查IP</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<table width="528" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="27" align="right"> </td>
<td align="center">asp 通過域名查IP</td>
<td> </td>
</tr>
<tr>
<td width="96" height="21" align="right">域名:</td>
<td width="288" align="center">
<input name="URL" type="text" id="URL" value="<%=Trim(Request.Form("URL"))%>" size="35" />
<input name="Search" type="hidden" id="Search" value="True" /></td>
<td width="144">
<input type="submit" name="Submit" value="查詢" /></td>
</tr>
</table>
</form>
<table width="528" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="64"> </td>
<td width="464">
<%
Search=Trim(Request.Form("Search"))
If Search="True" Then
URL=Trim(Request.Form("URL"))
Set objWShell=CreateObject("WScript.Shell")
Set objCmd=objWShell.Exec("ping "&url)
StrPResult=objCmd.StdOut.Readall()
Set objCmd=nothing
Set objWShell=nothing
On Error Resume Next
IP=strCut(StrPResult,"[","]",2)
If Err Then
Err.Clear
IP="<b>此IP未知或域名不可用!</b>"
End if
Response.Write("<b>查詢結果</b><br><br>您查詢的域名:"&URL&"<br><br>IP地址為:"&IP&"<br>")
'Response.Write("<p>"&Replace(StrPResult,vbCrLf,"<br>"))'輸出詳細內容
EndTime=Timer()
Response.Write("<br>查詢時間共用:"&FormatNumber((EndTime-STime),3,-1)&"</b> 秒")
End if
Function strCut(strContent,StartStr,EndStr,CutType)
Dim strHtml,S1,S2
strHtml = strContent
On Error Resume Next
Select Case CutType
Case 1
S1 = InStr(strHtml,StartStr)
S2 = InStr(S1,strHtml,EndStr)+Len(EndStr)
Case 2
S1 = InStr(strHtml,StartStr)+Len(StartStr)
S2 = InStr(S1,strHtml,EndStr)
End Select
If Err Then
strCute = "<p align='center'>沒有找到需要的內容。</p>"
Err.Clear
Exit Function
Else
strCut = Mid(strHtml,S1,S2-S1)
End If
End Function
%>
</td>
</tr>
</table>
</body>
</html>
7、如何在ASP讀取資料庫中的URL時截取URL的頂級域名並輸出來?
url=「h
t
t
p:
//
您的頂級域名/
目錄/
文件名字」
url1
=
right
(url,len(url)-7)
去除http://
url2
=
split(url1,"/")
以「/」
為標識分割字元版串
response.write
url2(0)
輸出頂權級域名
8、asp如何獲取域名來路參數
Request.QueryString["ip"]或Request.Form["ip"]);
9、asp如何獲取當前網站的域名
你可以在asp裡面用這一句話來獲取
Request.ServerVariables("SERVER_NAME")
為了更加直觀,在asp文件裡面寫上這一條語句試試:
你所訪問的域名是:<%=Request.ServerVariables("SERVER_NAME")%>
就會把你的域名直接顯示出來。