C 獨立網域名稱查詢

2021-03-31 08:56:28 字數 1564 閱讀 3579

whois.aspx

<% @page language="c#" %>

<% @import namespace="system.***.sockets" %>

<% @import namespace="system.text" %>

<% @import namespace="system.io" %>

<% @import namespace="system.collections" %>

void doquery(object sender, eventargs e)

;string arrdomain = strdomain.split(chsplit);

// es darf genau ein domain name + ein suffix sein

if (arrdomain.length != 2)

// das suffic darf nur 2 oder 3 zeichen lang sein

int nlength = arrdomain[1].length;

if (nlength != 2 && nlength != 3)

hashtable table = new hashtable();

table.add("at", "whois.nic.at");

table.add("de", "whois.denic.de");

table.add("be", "whois.dns.be");

table.add("gov", "whois.nic.gov");

table.add("mil", "whois.nic.mil");

string strserver = "whois.onlinenic.***";

if (table.containskey(arrdomain[1]))

else if (nlength == 2)

string strresponse;

bool bsuccess = dowhoislookup(strdomain, strserver, out strresponse);

if (bsuccess)

else

}bool dowhoislookup(string strdomain, string strserver, out string strresponse)

catch(socketexception ex)

strdomain += "/r/n";

byte arrdomain = encoding.ascii.getbytes(strdomain.tochararray());

try{

stream s = tcpc.getstream();

s.write(arrdomain, 0, strdomain.length);

streamreader sr = new streamreader(tcpc.getstream(), encoding.ascii);

stringbuilder strbuilder = new stringbuilder();

string strline = null;

C 網域名稱查詢

protected void btn click object sender,eventargs e else bool blsuccess iswhosissuccess strdomain,strserver,out strresponse if blsuccess else bool iswh...

本地配置獨立網域名稱環境

1 開啟虛擬主機配置項 以apache為例 把前面的 注釋去掉 開啟 修改後需重啟apache 2 設定檔案httpd vhosts.conf conf extra serveradmin webmaster dummy host2.example.com documentroot c apache...

獨立子查詢

獨立子查詢,可以返回乙個單獨,或多個值 包括表 它不依賴於它所屬的外部查詢。返回單獨值子查詢例子,返回作者為john最後論題所有回覆的記錄 select from dbo.subtopic where topicid select max topicid from dbo.topic where a...