首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

大家进来看看了哦!解决办法

2012-01-21 
大家进来看看了哦!我想在首页上做一个域名注册的框架,请问要怎么做呀,在线等,急![解决办法]路过,不清楚[解

大家进来看看了哦!
我想在首页上做一个域名注册的框架,请问要怎么做呀,在线等,急!

[解决办法]
路过,不清楚
[解决办法]
下面代码 是我收集关于搜索域名的  看看对你有没有用

<form id= "Form1 " action= "re.aspx " runat= "server ">
域名: www. <Asp:TextBox id= "txtDomain1 " Text= " " runat= "server " />
<Asp:RadioButton id= "txtDomain2 " GroupName= "RadioGroup1 " text= ".com " checked= "True " runat= "server " />
<Asp:RadioButton id= "txtDomain3 " GroupName= "RadioGroup1 " text= ".Net " runat= "server " />
<Asp:RadioButton id= "txtDomain4 " GroupName= "RadioGroup1 " text= ".org " runat= "server " />
<Asp:RadioButton id= "txtDomain5 " GroupName= "RadioGroup1 " text= ".biz " runat= "server " />
<Asp:RadioButton id= "txtDomain6 " GroupName= "RadioGroup1 " text= ".cc " runat= "server " />
<Asp:RadioButton id= "txtDomain7 " GroupName= "RadioGroup1 " text= ".cn " runat= "server " />
<Asp:RadioButton id= "txtDomain8 " GroupName= "RadioGroup1 " text= ".com.cn " runat= "server " />
<Asp:Button id= "btnQuery " OnClick= "doQuery " text= "查询 " runat= "server " />
<BR>
<HR width= "100% ">
<BR>
<Asp:label id= "txtResult " ForeColor= "#0000FF " runat= "server " />
</form>

CS里
String strDomain;
String strServer;
//http://www.china-channel.com/
//whois.pir.org/
//whois.uwhois.com
//whois.internic.net
//whois.crsnic.net
string strserver1 = "whois.uwhois.com ";
string strserver2 = "whois.cnnic.net.cn ";
public void doQuery(Object sender, EventArgs e)
{
if (txtDomain2.Checked)
{
strServer = strserver1;
strDomain = txtDomain1.Text + txtDomain2.Text;
}
if (txtDomain3.Checked)
{
strServer = strserver1;
strDomain = txtDomain1.Text + txtDomain3.Text;

}
if (txtDomain4.Checked)
{
strServer = strserver1;
strDomain = txtDomain1.Text + txtDomain4.Text;
}
if (txtDomain5.Checked)
{
strServer = strserver1;
strDomain = txtDomain1.Text + txtDomain5.Text;
}
if (txtDomain6.Checked)
{
strServer = strserver1;
strDomain = txtDomain1.Text + txtDomain6.Text;
}
if (txtDomain7.Checked)
{
strServer = strserver2;
strDomain = txtDomain1.Text + txtDomain7.Text;
}
if(txtDomain8.Checked)
{
strServer = strserver1;
strDomain = txtDomain1.Text + txtDomain8.Text;
}
String strResponse;
bool bSuccess = DoWhoisLookup(strDomain, strServer, out strResponse);
if (bSuccess)
{
txtResult.Text = strResponse;
}
else
{
txtResult.Text = "查询失败!请重试。 ";
}
}

public bool DoWhoisLookup(String strDomain, String strServer, out String strResponse)
{
strResponse = "none ";
bool bSuccess = false;

TcpClient tcpc = new TcpClient();
tcpc.Connect(strServer, 43);
strDomain += "\r\n ";


Byte[] arrDomain = Encoding.UTF8.GetBytes(strDomain.ToCharArray());
try
{
Stream s = tcpc.GetStream();
s.Write(arrDomain, 0, strDomain.Length);

StreamReader sr = new StreamReader(tcpc.GetStream(), Encoding.UTF8);
StringBuilder strBuilder = new StringBuilder();
while (-1 != sr.Peek())
{
strBuilder.Append(sr.ReadLine() + " <br> ");
}
tcpc.Close();

bSuccess = true;
strResponse = strBuilder.ToString();
if (strResponse.IndexOf( "No match ") > 0)
{
Response.Write( "恭喜你,该域名还未注册! ");
}
else if (strResponse.IndexOf( "no matching ") > 0)
{
Response.Write( "恭喜你,该域名还未注册! ");
}
else
{
Response.Write( "此域名已被注册! ");
}
}
catch (Exception e)
{
strResponse = e.ToString();
}

return bSuccess;
}
[解决办法]
你要找个域名供应商让他给你个接口,然后你调用接口就可以了
[解决办法]
这个不清楚
[解决办法]
搜索??
[解决办法]
这个好像不那么容易

热点排行