?? domaincreate_submit.aspx
字號(hào):
<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="gb2312" %>
<%@ Import Namespace="com.todayisp.NowClient" %>
<script language="C#" runat="server">
string msg=null,code=null,wrongMsg="";
bool isSuccess;
string responseXML=null,sendXML=null;
Hashtable resdataHash = new Hashtable();
ReceiveXML reXML;
private string domainSuffix(string domain){
string lastSuffix=domain.Substring(domain.LastIndexOf(".")+1,domain.Length-domain.LastIndexOf(".")-1);
return "dot"+lastSuffix;
}
public void Page_Load(object sender , EventArgs E)
{
try{
Hashtable domaininfo = new Hashtable();
Hashtable registhash = new Hashtable();
Hashtable adminhash = new Hashtable();
string domainstr = Request.Form["domain"];
domaininfo["domain"]=Request.Form["domain"];
domaininfo["period"]=Request.Form["period"];
domaininfo["chrNS1"]=Request.Form["chrNS1"];
domaininfo["chrNS2"]=Request.Form["chrNS2"];
registhash["name"]=Request.Form["OName"];
registhash["mname"]=Request.Form["OName_GB"];
registhash["org"]=Request.Form["OOrganization"];
registhash["morg"]=Request.Form["OOrganization_GB"];
registhash["cc"]=Request.Form["OCC"];
registhash["sp"]=Request.Form["OSP"];
registhash["pc"]=Request.Form["OPC"];
registhash["city"]=Request.Form["OCity"];
registhash["street"]=Request.Form["OStreet"];
registhash["street1"]=Request.Form["OStreet1"];
registhash["voice"]=Request.Form["OTel"];
registhash["fax"]=Request.Form["OFax"];
registhash["email"]=Request.Form["OEmail"];
registhash["mobile"]=Request.Form["Omobile"];
adminhash["name"]=Request.Form["AName"];
adminhash["mname"]=Request.Form["AName_GB"];
adminhash["org"]=Request.Form["AOrganization"];
adminhash["morg"]=Request.Form["AOrganization_GB"];
adminhash["cc"]=Request.Form["ACC"];
adminhash["sp"]=Request.Form["ASP"];
adminhash["pc"]=Request.Form["APC"];
adminhash["city"]=Request.Form["ACity"];
adminhash["street"]=Request.Form["AStreet"];
adminhash["street1"]=Request.Form["AStreet1"];
adminhash["voice"]=Request.Form["ATel"];
adminhash["fax"]=Request.Form["AFax"];
adminhash["email"]=Request.Form["AEmail"];
adminhash["mobile"]=Request.Form["Amob"];
Hashtable techhash = adminhash;
Hashtable billinghash = adminhash;
/* 可以使用兩種方式來(lái)注冊(cè)聯(lián)系,一種直接構(gòu)造Contact對(duì)象,第二種就是使用domain.createContact(string,Hashtable)函數(shù)
* 使用直接構(gòu)造Contact對(duì)象將不會(huì)返回聯(lián)系人的ID號(hào),只有在使用createContact(string,Hashtable)函數(shù)才有。
Contact regist = new Contact(registhash);
Contact admin = new Contact(adminhash);
Contact tech = new Contact(techhash);
Contact billing = new Contact(billinghash);
*/
Domain domain = new Domain(); //創(chuàng)建實(shí)例
Contact regist = domain.createContact(domainstr,registhash); //生成regist的聯(lián)系人
Contact admin = domain.createContact(domainstr,adminhash); //生成admin的聯(lián)系人
Contact tech = domain.createContact(domainstr,techhash); //生成tech的聯(lián)系人
Contact billing = domain.createContact(domainstr,billinghash); //生成billing的聯(lián)系人
domain.createDomain(domaininfo,regist.getContactID(),admin.getContactID(),tech.getContactID(),billing.getContactID()); //注冊(cè)域名
sendXML=domain.getsendXML(); //獲取發(fā)送的XML
ReceiveXML receivexml = new ReceiveXML(domain.getresponseXML()); //處理接收到的XML信息
msg = receivexml.getMsg();
code = receivexml.getCode();
isSuccess = receivexml.isSuccess();
responseXML=receivexml.getXML(domain.getresponseXML());
resdataHash=receivexml.getResData();
reXML=receivexml;
}catch(Exception ex){
wrongMsg=ex.Message+ex.StackTrace;
//Response.Write(ex.Message);
//Response.Write(ex.StackTrace);
}
}
</script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>模板</title>
<link href="../../images/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-bottom: 0px;
background-color: #CCCCCC;
}
-->
</style></head>
<body>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<th scope="row"><img src="../../images/top1.jpg" width="760" height="21"></th>
</tr>
</table>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" background="../../images/top2.gif">
<tr>
<td width="278" height="25" scope="row"> </td>
<td width="482" scope="row">時(shí)代互聯(lián)接口模式演示程序 Ver1.5</td>
</tr>
</table>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="76" background="../../images/top3.jpg" scope="row"><EMBED src="../../images/banner_2.swf" quality=high WIDTH="375" HEIGHT="76" wmode="transparent" menu="false"></embed><EMBED src="../../images/banner_2.swf" quality=high WIDTH="375" HEIGHT="76" wmode="transparent" menu="false"></embed></td>
</tr>
</table>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" background="../../images/top4.gif">
<tr>
<td width="267" height="30" scope="row"> </td>
<td width="493" scope="row"> <a href="../../index.htm">演示首頁(yè)</a> - <a href="index.htm">域名注冊(cè)</A></td>
</tr>
</table>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" background="../../images/middle.gif">
<tr>
<td width="202" height="100%" valign="top" scope="row"><table width="95%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0" background="../../images/drg.gif">
<tr>
<td height="35" background="../../images/bback01.jpg" scope="row"> <a href="../../index.htm" class="top">返回演示首頁(yè)</a></td>
</tr>
<tr>
<td height="25" align="left" background="../../images/bback02.gif" scope="row">
<STRONG>域名注冊(cè)</STRONG></td>
</tr>
<tr>
<td height="30" scope="row"><img src="../../images/bback03.gif" width="30" height="15" align="absmiddle"><a href="domainCreate.htm">創(chuàng)建域名</a></td>
</tr>
<tr>
<td height="30" scope="row"><img src="../../images/bback03.gif" width="30" height="15" align="absmiddle"><a href="domainRenew.htm">域名續(xù)費(fèi)</a>
</td>
</tr>
<tr>
<td height="30" scope="row"><img src="../../images/bback03.gif" width="30" height="15" align="absmiddle"><a href="domainInfo.htm">查詢域名信息</a></td>
</tr>
<tr>
<td height="30" scope="row"><img src="../../images/bback03.gif" width="30" height="15" align="absmiddle"><a href="domainCheck.htm">查詢域名是否注冊(cè)</a></td>
</tr>
<tr>
<td height="30" scope="row"><img src="../../images/bback03.gif" width="30" height="15" align="absmiddle"><a href="domainModify.htm">修改域名DNS</a></td>
</tr>
<tr>
<td height="30" scope="row"><img src="../../images/bback03.gif" width="30" height="15" align="absmiddle"><a href="contactCreate.htm">注冊(cè)聯(lián)系人</a></td>
</tr>
<tr>
<td height="30" scope="row"><img src="../../images/bback03.gif" width="30" height="15" align="absmiddle"><a href="contactUpdate.htm">聯(lián)系人更新</a></td>
</tr>
<tr>
<td height="30" scope="row"><img src="../../images/bback03.gif" width="30" height="15" align="absmiddle"><a href="contactInfo.htm">查詢聯(lián)系人</a></td>
</tr>
<tr>
<td height="30" scope="row"><img src="../../images/bback03.gif" width="30" height="15" align="absmiddle"><a href="nsCheck.htm">檢查域名服務(wù)器是否存在</a></td>
</tr>
<tr>
<td height="30" scope="row"><img src="../../images/bback03.gif" width="30" height="15" align="absmiddle"><a href="nsCreate.htm">注冊(cè)域名服務(wù)器</a></td>
</tr>
<tr>
<td height="100%" scope="row"> </td>
</tr>
</table></td>
<td width="558" valign="top" scope="row"><br>
<table width="98%" border="1" align="center" cellpadding="1" cellspacing="0" bordercolorlight="#FFFFFF" bordercolor="#F5EEE8">
<tr>
<td scope="row"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th height="20" bgcolor="#f7f7f7" scope="row"> = 接口模式演示程序使用說(shuō)明
- 申請(qǐng)域名注冊(cè) 返回結(jié)果=</th>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th width="13%" scope="row"><img src="../../images/register.jpg" width="66" height="66" hspace="10" vspace="10"></th>
<td width="87%">1、狀態(tài):<%=code%><br>
2、信息:<%=msg%> <br>
3、是否成功: <%=isSuccess%><br>
<%
try{
if(resdataHash.Count!=0){
Response.Write("<br>返回注冊(cè)信息:<br>");
/*
ArrayList array=new ArrayList(resdataHash.Keys);
IEnumerator en=array.GetEnumerator();
while(en.MoveNext()){
Response.Write((string)en.Current+":");
Response.Write(resdataHash[en.Current]+"<br>");
}*/
Response.Write("域名:"+resdataHash["domain:name"]+" ");
Response.Write("域名ID:"+resdataHash["domain:roid"]+"<br>");
if(reXML!=null){
string[] contacttype = reXML.getResDataNode("domain:contact","type").Split(';');
string[] contactid = resdataHash["domain:contact"].ToString().Split(';');
//string[] contactpw = reXML.getResDataNode("domain:contact","pw").Split(';');
for(int i=0;i<contacttype.Length-1;i++){
Response.Write("聯(lián)系類型:"+contacttype[i]+" 聯(lián)系人ID:"+contactid[i]+"<br>");
}
}
Response.Write("創(chuàng)建時(shí)間:"+resdataHash["domain:dtCreate"]+"<br>");
Response.Write("更新時(shí)間:"+resdataHash["domain:dtUpdate"]+"<br>");
Response.Write("過(guò)期時(shí)間:"+resdataHash["domain:dtExpired"]+"<br>");
Response.Write("域名服務(wù)器:"+resdataHash["domain:ns1"]+"<br>");
Response.Write("域名服務(wù)器:"+resdataHash["domain:ns2"]+"<br>");
}
if(wrongMsg!="") Response.Write(wrongMsg);
}catch(Exception ex){
Response.Write("錯(cuò)誤信息:"+ex.Message);
Response.Write(ex.StackTrace);
}
%></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="20" align="left" bgcolor="#f7f7f7" scope="row">A、返回的XML信息如下:</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th scope="row"><textarea name="textarea" cols="85%" rows="15" class="formstyle">
<% try { %>
<%=responseXML.Replace("<","\r\n<")%>
<% } catch (Exception ex) { Response.Write("Is Empty Content !!"); }%>
</textarea></th>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="20" align="left" bgcolor="#f7f7f7" scope="row">B、發(fā)送的XML信息如下:</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th scope="row"><textarea name="textarea" cols="85%" rows="15" class="formstyle"><%=sendXML%></textarea></th>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="760" height="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#F5EEE8">
<tr>
<td valign="top" scope="row"><img src="../../images/down.gif" width="760" height="50"></td>
</tr>
<tr>
<td align="center" scope="row"><br>
時(shí)代互聯(lián) 版權(quán)所有<br>
</td>
</tr>
</table>
</body>
</html>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -