Whois查询程序下载
  我们免费提供ASP/PHP/AJAX等各种版本的查询程序下载,请根据您的需要下载使用合适的版本。

  1. PHP版代码
  2. ASP版代码
PHP版本代码
核心函数
function getWhoisInfo($domain){
	$url="http://www.nwois.cn/?domain=".$domain;
	$contents =@file_get_contents($url);
	$startPos="<pre>";
	$endPos="</pre>";
	$Pattern="($startPos).*($endPos)";
	ereg($Pattern,$contents,$res);
	$res= eregi_replace($endPos,"",$res[0]);
	return $res;
}
		
下载地址
ASP版本代码
核心函数
function getWhoisInfo(domain)
	set http=server.CreateObject("Microsoft.XMLHTTP")
	whoisUrl="http://www.nwois.cn/?domain="&domain
	Err.Clear
	http.Open "POST", whoisUrl, False
	http.Send ""
	if Err.Number = 0 Then
		vIn=encode(http.responsebody)
		getWhoisInfo="<pre>" & getstr(vIn,"<pre>","</pre>") & "</pre>"
	End if
End Function 

function getstr(content,bstr,estr)   
	pstart=instr(content,bstr)+len(bstr)   
	slen=instr(content,estr)-pstart   
	tmpstr=mid(content,pstart,slen)   
	tmpstr=replace(tmpstr,vbcrlf,"")   
	getstr=tmpstr   
End Function 

function encode(vIn)
	dim strReturn,ThisCharCode,q,NextCharCode
	strReturn = ""
	For q = 1 To LenB(vIn)
		ThisCharCode = AscB(MidB(vIn,q,1))
		If ThisCharCode < &H80 Then
		   strReturn = strReturn & Chr(ThisCharCode)
		Else
		   NextCharCode = AscB(MidB(vIn,q+1,1))
		   strReturn = strReturn & Chr(CLng(ThisCharCode)*&H100 + CInt(NextCharCode))
		   q = q + 1
		End If
	Next
	encode=strReturn
end Function
		
下载地址
Copy Right © nwhois.cn. runtime 20.436ms
2002-2024 粤ICP备09063828号