Форум АНТИЧАТ

Форум АНТИЧАТ (https://forum.antichat.xyz/index.php)
-   С/С++, C#, Delphi, .NET, Asm (https://forum.antichat.xyz/forumdisplay.php?f=24)
-   -   [C#]whois script failed (https://forum.antichat.xyz/showthread.php?t=85431)

dimash 19.09.2008 21:46

[C#]whois script failed
 
ekraner.qsh.eu/whois.aspx, whois.rar

Jes 20.09.2008 19:38

Код в студию , опционально с более подробным описанием проблемы

dimash 22.09.2008 01:02

That whois program. -> http://www.ekraner.qsh.eu/whois.aspx. That source code. -> http://www.ekraner.qsh.eu/whois.txt. When i writen for example such domain as site.net whois back false result.

Jes 22.09.2008 15:05


sry , my Eng Grammar Suxx

oh , this example just send data to whois.ripe.net and parse response to Text Item ,

Some knowledge of the protocol can be usefull

http://en.wikipedia.org/wiki/WHOIS

also try this example...

http://209.85.135.104/search?q=cache:zFLtssWT1DwJ:www.stewshack.com/aspnet/WhoIs.aspx&hl=ru&ct=clnk&cd=4

dimash 28.09.2008 21:44

Нету такого http://www.stewshack.com/aspnet/WhoIs.aspx адреса.

procedure 01.01.2009 18:53

Решение:
Код:

TcpClient tcpc = new TcpClient();
try
{
  tcpc.Connect("whois.networksolutions.com", 43);
}
catch(SocketException ex)
{
  Response.Write(ex.ToString());
  Response.End();
}

String strDomain = "forum.antichat.ru\r\n";
Byte[] arrDomain = Encoding.ASCII.GetBytes(strDomain.ToCharArray());
 
Stream s = tcpc.GetStream();
s.Write(arrDomain, 0, strDomain.Length);

StreamReader sr = new StreamReader(tcpc.GetStream(), Encoding.ASCII);
string strLine = null;

while (null != (strLine = sr.ReadLine()))
{
  Response.Write(strLine + "<br>");
}

tcpc.Close();

Сори что поднял.


Время: 00:43