<strike id="uohm1"></strike>
  • <label id="uohm1"><sub id="uohm1"><rt id="uohm1"></rt></sub></label>
  • <ol id="uohm1"><optgroup id="uohm1"></optgroup></ol>
    <label id="uohm1"><sub id="uohm1"><rt id="uohm1"></rt></sub></label><label id="uohm1"></label>

  • <label id="uohm1"></label><label id="uohm1"></label>

    蘇州網絡公司教你如何通過JS調用萬網域名查詢接口

    2012-03-18 關鍵詞: 4882

    1.新建一個aspx頁面,刪除前臺代碼,后臺代碼如下

    try
                    {
                        if (Request.QueryString["domains"] != null)
                        {
                            StringBuilder sb = new StringBuilder();
                            sb.Append("[");
                            foreach (string domain in Request.QueryString["domains"].Split(','))
                            {
                                WebRequest wr = WebRequest.Create("http://panda.www.net.cn/cgi-bin/check.cgi?area_domain=" + domain);
                                //wr.Timeout = 10000;
                                string strHtml = new StreamReader(wr.GetResponse().GetResponseStream()).ReadToEnd();
                                XmlDocument xd = new XmlDocument();
                                xd.LoadXml(strHtml);
                                XmlNode root = xd.SelectSingleNode("property");

                                sb.Append(",{\"returncode\":\"" + root.ChildNodes[0].InnerText + "\",\"key\":\"" + root.ChildNodes[1].
                                    InnerText + "\",\"original\":\"" + root.ChildNodes[2].InnerText + "\"}");
                            }
                            sb.Append("]");
                            string s = sb.ToString().Replace("[,","[");
                            Response.Write(s);
                        }
                    }
                    catch (Exception ex)
                    {
                        Response.Write(ex.ToString());
                    }

    2.通過jquery ajax的方式,調用前面新建的aspx頁,如圖

     $.ajax({
                        type: "get",
                        dataType: "json",
                        url: 'checkdomain.aspx',
         data: 'domains='+domains,//此處傳遞多個域名到checkdomain.aspx,以逗號分隔
         cache: false,
                        success: function (returndata) {
           $.each(returndata, function(i, n){
           //n.original
           //n.key
          })
                        }
                    });

    萬網域名注冊查詢接口(API)說明

    1、域名查詢
    接口采用HTTP,POST,GET協議:
    調用URL:http://panda.www.net.cn/cgi-bin/check.cgi
    參數名稱:area_domain 值為標準域名,例:hichina.com
    調用舉例:
    http://panda.www.net.cn/cgi-bin/check.cgi?area_domain=qxue8.com

    返回XML:

    <?xml version="1.0" encoding="gb2312"?>
    <property>
    <returncode>200</returncode>
    <key>qxue8.com</key>
    <original>211 : Domain name is not available</original>
    </property>
    返回 XML 結果說明:
    returncode=200 表示接口返回成功
    key=***.com表示當前check的域名
    original=210 : Domain name is available     表示域名可以注冊
    original=211 : Domain name is not available 表示域名已經注冊
    original=212 : Domain name is invalid   表示域名參數傳輸錯誤
     

     

    首頁 網站建設 小程序 品牌設計 服務項目 案例展示 售后保障 聯系方式 新聞中心 關于我們 人才招聘
    我們的優勢

    細致入微的前期服務
    精準的策劃服務
    精湛的網頁設計
    穩定 可靠 極速的域名和服務器
    任何問題,24小時回復并處理

    版權所有:蘇州謝謝網絡傳媒有限公司  蘇ICP備11087090號   

    首頁 電話 服務項目
    久久久国产99久久国产久首页|真人无码视频|免费一级无码婬片A|国产激情久久久久影院老熟女|伊人热热久久原色播放www
    <strike id="uohm1"></strike>
  • <label id="uohm1"><sub id="uohm1"><rt id="uohm1"></rt></sub></label>
  • <ol id="uohm1"><optgroup id="uohm1"></optgroup></ol>
    <label id="uohm1"><sub id="uohm1"><rt id="uohm1"></rt></sub></label><label id="uohm1"></label>

  • <label id="uohm1"></label><label id="uohm1"></label>