当前位置: 代码迷 >> ASP.NET >> 大家进来看看了哦!解决办法
  详细解决方案

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

热度:683   发布时间:2013-02-25 00:00:00.0
大家进来看看了哦!
我想在首页上做一个域名注册的框架,请问要怎么做呀,在线等,急!

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

<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 ";
  相关解决方案