不错呦!smile@林凯西,确保“准备文件”中的几个文件都有安装,S...您好,看了您这篇帖子觉得很有帮助。但是有个问题想请...我的修改过了怎么还被恶意注册呢 @jjjjiiii 用PJ快9年了,主要是A...PJ3啊,貌似很少有人用PJ了,现在不是WP就是z...@332347365,我当时接入时错误码没有-10...楼主,ChkValue值应为-103是什么意思呢?...大哥 你最近能看到我发的信息,请跟我联系,我有个制...
万网域名查询接口(API)说明
编辑:dnawo 日期:2012-10-10
接口地址
http://panda.www.net.cn/cgi-bin/check.cgi
接口参数(GET)
area_domain:查询域名
返回内容
引用内容
original值类型:
1).域名可以注册:210 : Domain name is available
2).域名已经注册:211 : Domain name is not available
3).参数传输错误:212 : Domain name is invalid
4).查询超时:213 : Timeout
C#域名查询类
参考资料
[1].API代理商业务接口域名whois接口编码:http://www.net.cn/service/faq/other/sp/200611/1538.html
http://panda.www.net.cn/cgi-bin/check.cgi
接口参数(GET)
area_domain:查询域名
返回内容

<?xml version="1.0" encoding="gb2312"?>
<property>
<returncode>接口状态码,200为成功</returncode>
<key>查询域名</key>
<original>域名状态</original>
</property>
<property>
<returncode>接口状态码,200为成功</returncode>
<key>查询域名</key>
<original>域名状态</original>
</property>
original值类型:
1).域名可以注册:210 : Domain name is available
2).域名已经注册:211 : Domain name is not available
3).参数传输错误:212 : Domain name is invalid
4).查询超时:213 : Timeout
C#域名查询类
复制内容到剪贴板
程序代码

using System;
using System.IO;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml;
namespace ConsoleApplication1
{
public static class Domain
{
/// <summary>
/// 域名查询
/// </summary>
/// <param name="domain"></param>
/// <returns>
/// -1 : Exception
/// 210 : Domain name is available
/// 211 : Domain name is not available
/// 212 : Domain name is invalid
/// 213 : Timeout
/// </returns>
public static int Check(string domain)
{
int result = -1;
try
{
Encoding encoding = Encoding.GetEncoding("gb2312");
Uri uri = new Uri(string.Format("http://panda.www.net.cn/cgi-bin/check.cgi?area_domain={0}", domain));
WebRequest webRequest = WebRequest.Create(uri);
WebResponse webResponse = webRequest.GetResponse();
using (StreamReader streamReader = new StreamReader(webResponse.GetResponseStream(), encoding))
{
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.LoadXml(streamReader.ReadToEnd());
XmlNode xmlNode = xmlDocument.SelectSingleNode("/property/original");
if (xmlNode != null)
{
Match match = Regex.Match(xmlNode.InnerText, @"\d+");
if (match.Success)
{
return int.Parse(match.Value);
}
}
}
}
catch { }
return result;
}
}
}
using System.IO;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml;
namespace ConsoleApplication1
{
public static class Domain
{
/// <summary>
/// 域名查询
/// </summary>
/// <param name="domain"></param>
/// <returns>
/// -1 : Exception
/// 210 : Domain name is available
/// 211 : Domain name is not available
/// 212 : Domain name is invalid
/// 213 : Timeout
/// </returns>
public static int Check(string domain)
{
int result = -1;
try
{
Encoding encoding = Encoding.GetEncoding("gb2312");
Uri uri = new Uri(string.Format("http://panda.www.net.cn/cgi-bin/check.cgi?area_domain={0}", domain));
WebRequest webRequest = WebRequest.Create(uri);
WebResponse webResponse = webRequest.GetResponse();
using (StreamReader streamReader = new StreamReader(webResponse.GetResponseStream(), encoding))
{
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.LoadXml(streamReader.ReadToEnd());
XmlNode xmlNode = xmlDocument.SelectSingleNode("/property/original");
if (xmlNode != null)
{
Match match = Regex.Match(xmlNode.InnerText, @"\d+");
if (match.Success)
{
return int.Parse(match.Value);
}
}
}
}
catch { }
return result;
}
}
}
参考资料
[1].API代理商业务接口域名whois接口编码:http://www.net.cn/service/faq/other/sp/200611/1538.html






评论: 0 | 引用: 0 | 查看次数: 4025
发表评论
请登录后再发表评论!