domain=trim(Request ("domain"))
'set ComX=server.CreateObject("freehost_com_7i24.FreehostM")
'domain=ComX.idntoac_7i24_com(Cstr(domain))domainarry=split(domain,".")
tar="http://panda.www.net.cn/cgi-bin/Whois.cgi?domain="&server.URLEncode(domainarry(0))&"&referer=http://www.net.cn/static/domain/&"
domtemp=replace(domain,domainarry(0),"")domtemp=replace(domtemp,".中国",".cn")
domtemp=replace(domtemp,".网络",".net.cn")
domtemp=replace(domtemp,".公司",".com.cn")'response.write domtemp
'response.end
xend=replace(domtemp,".","")&"=yes"
tar=tar&xendretdns=P_GETx(tar,"http://www.net.cn/static/domain/")
   
Function P_GETx(tar,ref)
Dim returnstr
Set xml = Server.CreateObject("Msxml2.ServerXMLHTTP.3.0")
xml.setTimeouts FreeHost_t1, FreeHost_t2, FreeHost_t3, FreeHost_t4
xml.Open "GET", tar, False
xml.setRequestHeader "User-Agent","Mozilla/2.0 (compatible; MSIE 5.0B; Windows NT)"
xml.setRequestHeader "REFERER",ref
xml.send
returnstr = bytes2BSTR(xml.responsebody)
P_GETx = returnstr
End Function

解决方案 »

  1.   

            string domain = Request["domain"].Trim();        string[] domainarry = domain.Split(".");
            string tar = "http://panda.www.net.cn/cgi-bin/Whois.cgi?domain=" + Server.UrlEncode(domainarry[0]) + "&referer=http://www.net.cn/static/domain/&"
            string domtemp = domain.Replace(domainarry[0],"");
            domtemp = domtemp.Replace(".中国",".cn");
            domtemp=domtemp.Replace(".网络",".net.cn");
            domtemp=domtemp.Replace(".公司",".com.cn");        string xend = domtemp.Replace(".","")&"=yes";
            tar=tar&xend;        string retdns=P_GETx(tar,"http://www.net.cn/static/domain/");
    public string P_GETx(string tar , string url)
        {
            string returnstr;
            try 
        {         
        WebRequest request = WebRequest.Create(url);
                request.Timeout=20000;
                WebResponse response = request.GetResponse();
                Stream resStream = response.GetResponseStream();
                StreamReader sr = new StreamReader(resStream, System.Text.Encoding.Default);
                returnstr=sr.ReadToEnd();
                resStream.Close();
                response.Close();
                request.Abort();
                sr.Close();
        }
        catch (WebException ex)
            {
                if (ex.Status == WebExceptionStatus.ConnectFailure)
                {
                    //无法连接到远程服务器, --换代理 IP 
                    //MessageBox.Show(ex.ToString()); 
                    //初始化代理  IP 
                    returnstr="无法连接到远程服务器";
                }
                else if (ex.Status == WebExceptionStatus.Timeout)
                {
                    //超时 --换代理 IP 
                    //MessageBox.Show(ex.ToString()); 
                    returnstr="超时";
                }
                else if (ex.Status == WebExceptionStatus.ProtocolError)
                {
                    //文件未找到--跳出 
                    //MessageBox.Show(ex.ToString()); 
                    returnstr="文件未找到";
                }
            }
        }这样是否可行?
    高手指点一下.