Arşiv Anasayfa ASP.NET Soruları
Sayfalar: 1
Domain Kontrol Gönderen: erenalp Tarih: 07 March 2008 11:14:59
http://www.aspnedir.com/Article/DisplayArticle.aspx?ID=779

Bu sitedeki  kodu nasıl delphi.nete uyarlayacağız.Çok güzel olmuş ama dil farklı olunca çevirmeside zor oluyor. Embarrassed
Ynt: Domain Kontrol Gönderen: kocaturk Tarih: 07 March 2008 12:53:47
procedure WhoisRequest.btnQuery_Click(sender: System.Object; e: EventArgs);
type
 TArrayOfByte = array of Byte;
var
 match: Match;
 &end: string;
 srart: string;
 buffer1: TArrayOfByte;
 URL: string;
begin
 try
   URL := (('http://www.directnic.com/whois/index.php?query=' + Self.txtDomain.Text)
     + DropDownList1.SelectedItem.Text);
   buffer1 := WebClient.Create.DownloadData(URL);
   Self.response := Encoding.Default.GetString(buffer1);
 except
   on exception3: WebException do
     Self.txtResult.Text := exception3.Message;
 end;
 try
   srart := '<p class="text12">';
   &end := '</p>';
   match := Regex.Create((((srart + '(?<MYDATA>.*?(?=') + &end) + '))'), (RegexOptions.Singleline
       or RegexOptions.IgnoreCase)).Match(Self.response);
   Self.txtResult.Text := (match.Groups['MYDATA'].Value + '<br>');
   if (match.Groups['MYDATA'].Success = False) then
     lblSonuc.Text := 'Bu Domain Adını Register Edebilirsiniz..'
   else
     lblSonuc.Text := 'Bu Domain Adı Register Edilmiş..';
 except
   on System.Exception do
     Self.txtResult.Text := 'Sorry the whois information is currently not available !!';
 end;
end;
 
 

Gerisini artık sen halledersin.
Ynt: Domain Kontrol Gönderen: erenalp Tarih: 07 March 2008 14:01:43
hocam match de hata veriyor
Ynt: Domain Kontrol Gönderen: kocaturk Tarih: 07 March 2008 14:58:32
Şu an Delphi im yanımda yok akşam eve gidince bir bakayım görüşürüz.
Ynt: Domain Kontrol Gönderen: kocaturk Tarih: 07 March 2008 19:23:55
Öncelikle System.Text.RegularExpressions, System.Net, System.Text namespace lerini uses bloğuna ekle daha sonra kodu aşağıdaki gibi değiştir.

Ben denedim çalışıyor yalnız, sorgulamanın yapıldığı sitenin sonuç formatı değiştiği için sadece domain in kullanımda olup olmadığını görebiliyorsun, kullanımda olan bir domain in kayıt ayrıntılarını göremiyorsun.

procedure TWebForm1.Button2_Click(sender: TObject; e: System.EventArgs);
type
 TArrayOfByte = array of Byte;
var
 match: System.Text.RegularExpressions.Match;
 &end: string;
 start: string;
 buffer1: TArrayOfByte;
 URL: string;
 Response : String;
begin
Response := '';
 try
   URL := (('http://www.directnic.com/whois/index.php?query=' + Self.txtDomain.Text)
     + DropDownList1.SelectedItem.Text);
   buffer1 := WebClient.Create.DownloadData(URL);
   Response := Encoding.Default.GetString(buffer1);
 except
   on exception3: WebException do
     Self.txtResult.Text := exception3.Message;
 end;
 try
   start := '<p class="text12">';
   &end := '</p>';
   match := Regex.Create((((start + '(?<MYDATA>.*?(?=') + &end) + '))'),
      (RegexOptions.Singleline or RegexOptions.IgnoreCase)).Match(Response);
   Self.txtResult.Text := (match.Groups['MYDATA'].Value + '<br>');
   if (match.Groups['MYDATA'].Success = False) then
     lblSonuc.Text := 'Bu Domain Adını Register Edebilirsiniz..'
   else
     lblSonuc.Text := 'Bu Domain Adı Register Edilmiş..';
 except
   on System.Exception do
     Self.txtResult.Text := 'Sorry the whois information is currently not available !!';
 end;
end;
 


Ynt: Domain Kontrol Gönderen: erenalp Tarih: 09 March 2008 19:10:00
hocam sizlerden öğrenecek çok şeyimiz var.Minnettarım size
Ynt: Domain Kontrol Gönderen: kocaturk Tarih: 09 March 2008 21:42:14
Estağfirullah Erenalp, ilk mesajda domain ile ilgili ayrıntılı bilgilerin alınamadığını söylemiştim ama, az önce denedim o da çalışıyor sanıyorum sende fark etmişsindir, ama bir uyarı dahi yazmamışsın Smile
Ynt: Domain Kontrol Gönderen: erenalp Tarih: 11 March 2008 15:13:48
sağolun hocam yapıyor.Teşekkür ederim.