Konuyu Oyla:
  • Derecelendirme: 0/5 - 0 oy
  • 1
  • 2
  • 3
  • 4
  • 5
Delphi siteye yorum
#11
(30-05-2018, Saat: 22:04)Paranoyaq Adlı Kullanıcıdan Alıntı:
function DoLogin(const username,email,url,comment: string): string;
var
IdHTTP: TIdHTTP;
Request: TStringList;
begin
try
  Request := TStringList.Create;
  try
    Request.Add('action=do_login');
    Request.Add('url=https://www.oyunkabini.com/battlefield-v-ilk-fragmanini-yayinladi-ve-daha-fazlasi-dlc-premium-passes/');
    Request.Add('submit=727');
    Request.Add('author'+username);
    Request.Add('email='+email);
    Request.Add('url='+url);
    Request.Add('comment='+comment);
    Request.Add('submit');
    IdHTTP := TIdHTTP.Create;
    try
      IdHTTP.AllowCookies := True;
      IdHTTP.HandleRedirects := True;
      IdHTTP.Request.ContentType := 'application/x-www-form-urlencoded';
      IdHTTP.Post('https://www.oyunkabini.com/wp-comments-post.php', Request);
      Result := IdHTTP.Get('http://www.oyunkabini.com');
      if StrUtils.ContainsStr(Result, 'submit') then //Login başarısız demektir
        Result := '';
    finally
      IdHTTP.Free;
    end;
  finally
    Request.Free;
  end;
except
  Result := '';
end;
end;

Kodlarında yanlışlarım nelerdir ?

Merhaba,
Request.Add('author'+username); satırı, Request.Add('author='+username); şeklinde mi olmalı? Her parametre adından sonra = işareti var. Yalnızca bu satırda yok.
Önemli: except ifadesi olduğu sürece hatayı yakalamanız çok zor.
Cevapla
#12
(30-05-2018, Saat: 22:04)Paranoyaq Adlı Kullanıcıdan Alıntı:
function DoLogin(const username,email,url,comment: string): string;
var
IdHTTP: TIdHTTP;
Request: TStringList;
begin
try
  Request := TStringList.Create;
  try
    Request.Add('action=do_login');
    Request.Add('url=https://www.oyunkabini.com/battlefield-v-ilk-fragmanini-yayinladi-ve-daha-fazlasi-dlc-premium-passes/');
    Request.Add('submit=727');
    Request.Add('author'+username);
    Request.Add('email='+email);
    Request.Add('url='+url);
    Request.Add('comment='+comment);
    Request.Add('submit');
    IdHTTP := TIdHTTP.Create;
    try
      IdHTTP.AllowCookies := True;
      IdHTTP.HandleRedirects := True;
      IdHTTP.Request.ContentType := 'application/x-www-form-urlencoded';
      IdHTTP.Post('https://www.oyunkabini.com/wp-comments-post.php', Request);
      Result := IdHTTP.Get('http://www.oyunkabini.com');
      if StrUtils.ContainsStr(Result, 'submit') then //Login başarısız demektir
        Result := '';
    finally
      IdHTTP.Free;
    end;
  finally
    Request.Free;
  end;
except
  Result := '';
end;
end;

Kodlarında yanlışlarım nelerdir ?

Except'i kaldırıp hata resimlerini atarsan daha hızlı bulabiliriz Smile
kisisel_logo_dark.png
WWW
Cevapla
#13
function DoLogin(const username,email,url,comment: string): string;
var
IdHTTP: TIdHTTP;
Request: TStringList;
begin
try
 Request := TStringList.Create;
 try
   Request.Add('action=do_login');
   Request.Add('url=https://www.oyunkabini.com/battlefield-v-ilk-fragmanini-yayinladi-ve-daha-fazlasi-dlc-premium-passes/');
   Request.Add('submit=727');
   Request.Add('author='+username);
   Request.Add('email='+email);
   Request.Add('url='+url);
   Request.Add('comment='+comment);
   Request.Add('submit');
   IdHTTP := TIdHTTP.Create;
   try
     IdHTTP.AllowCookies := True;
     IdHTTP.HandleRedirects := True;
     IdHTTP.Request.ContentType := 'application/x-www-form-urlencoded';
     IdHTTP.Post('https://www.oyunkabini.com/wp-comments-post.php', Request);
     Result := IdHTTP.Get('http://www.oyunkabini.com');
     if StrUtils.ContainsStr(Result, 'submit') then //Login başarısız demektir
       Result := '';
   finally
     IdHTTP.Free;
   end;
 finally
   Request.Free;
 end;
finally
 Result := '';
end;
end;

except yerine finally

buton kodum 
memo2.Lines.Add(DoLogin(edit1.Text,edit2.Text,edit3.Text,memo1.Text));

Hata Could Not Load SSL library
Cevapla
#14
(31-05-2018, Saat: 00:00)Paranoyaq Adlı Kullanıcıdan Alıntı:
function DoLogin(const username,email,url,comment: string): string;
var
IdHTTP: TIdHTTP;
Request: TStringList;
begin
try
 Request := TStringList.Create;
 try
   Request.Add('action=do_login');
   Request.Add('url=https://www.oyunkabini.com/battlefield-v-ilk-fragmanini-yayinladi-ve-daha-fazlasi-dlc-premium-passes/');
   Request.Add('submit=727');
   Request.Add('author='+username);
   Request.Add('email='+email);
   Request.Add('url='+url);
   Request.Add('comment='+comment);
   Request.Add('submit');
   IdHTTP := TIdHTTP.Create;
   try
     IdHTTP.AllowCookies := True;
     IdHTTP.HandleRedirects := True;
     IdHTTP.Request.ContentType := 'application/x-www-form-urlencoded';
     IdHTTP.Post('https://www.oyunkabini.com/wp-comments-post.php', Request);
     Result := IdHTTP.Get('http://www.oyunkabini.com');
     if StrUtils.ContainsStr(Result, 'submit') then //Login başarısız demektir
       Result := '';
   finally
     IdHTTP.Free;
   end;
 finally
   Request.Free;
 end;
finally
 Result := '';
end;
end;

except yerine finally

buton kodum 
memo2.Lines.Add(DoLogin(edit1.Text,edit2.Text,edit3.Text,memo1.Text));

Hata Could Not Load SSL library

Direkt hatayı yazsan koda gerek kalmayacak... Sadece SSLLib DLL paketini yükle uygulamanın yanına yükle. Forumda mevcut konu bizzat ben açmıştım zaten Smile
kisisel_logo_dark.png
WWW
Cevapla
#15
(31-05-2018, Saat: 00:01)hyperxman Adlı Kullanıcıdan Alıntı:
(31-05-2018, Saat: 00:00)Paranoyaq Adlı Kullanıcıdan Alıntı:
function DoLogin(const username,email,url,comment: string): string;
var
IdHTTP: TIdHTTP;
Request: TStringList;
begin
try
 Request := TStringList.Create;
 try
   Request.Add('action=do_login');
   Request.Add('url=https://www.oyunkabini.com/battlefield-v-ilk-fragmanini-yayinladi-ve-daha-fazlasi-dlc-premium-passes/');
   Request.Add('submit=727');
   Request.Add('author='+username);
   Request.Add('email='+email);
   Request.Add('url='+url);
   Request.Add('comment='+comment);
   Request.Add('submit');
   IdHTTP := TIdHTTP.Create;
   try
     IdHTTP.AllowCookies := True;
     IdHTTP.HandleRedirects := True;
     IdHTTP.Request.ContentType := 'application/x-www-form-urlencoded';
     IdHTTP.Post('https://www.oyunkabini.com/wp-comments-post.php', Request);
     Result := IdHTTP.Get('http://www.oyunkabini.com');
     if StrUtils.ContainsStr(Result, 'submit') then //Login başarısız demektir
       Result := '';
   finally
     IdHTTP.Free;
   end;
 finally
   Request.Free;
 end;
finally
 Result := '';
end;
end;

except yerine finally

buton kodum 
memo2.Lines.Add(DoLogin(edit1.Text,edit2.Text,edit3.Text,memo1.Text));

Hata Could Not Load SSL library

Direkt hatayı yazsan koda gerek kalmayacak... Sadece SSLLib DLL paketini yükle uygulamanın yanına yükle. Forumda mevcut konu bizzat ben açmıştım zaten Smile

Bende denemiştim senin konundaki gibi SSL sürümünden kaynaklanmış şuan hata vermiyor fakat yorumda yok
Cevapla
#16
"fakat yorumda yok"

Bundan sonrası kodlarını iyice kontrol et Smile
kisisel_logo_dark.png
WWW
Cevapla
#17
Merhaba,
Şuan tek sıkıntıyı gönderim aşamasında yaşadığınızı varsayarak aşağıdaki adımları inceleyerek bir karşılaştırma yapın.
Öncelikle gönderim esnasında sizin yorum yazacağınız sayfa linkine ihtiyacınız yok. Bu sayfa bilgileri içerisinde yer alan comment_parant ve comment_parant _ID bilgilerine ihtiyacınız var sürekli aynı sayfada işlem yaptığınız için 727 değerini sabit bir değer olarak düşünmeyin. 727 değeri "battlefield" tanıtım sayfasının ID değeridir. Eğer "pubg-versiyon-1-0-guncelleme-ayrintilari" sayfasına post yapacaksanız bunun comment_parant _ID değeri 345 tir. parent değeri yine Sıfırdır.

Aşağıdaki son resimde gönderim yapacağımız için Method değerini POST olarak seçiyoruz. Daha sonra "Send Request" ile gönderimi yapıyoruz. 2 numaralı alan bize sonucu bildiriyor olacak. 200:OK değeri işlemin başarılı olduğunu bildiriyor. Resimlerde olduğu gibi bilgileri doldurduktan sonra 3 numara ile işaretlediğim "Copy COmponents" butonu ile verileri hafızaya alın ve projenizde yada boş bir projede "Ctrl+V" ile bilgileri aktarın. "Object Inspector" penceresinden ilgili Componentlerin Properties değerlerini inceleyin.
İyi Çalışmalar.

Rest_0.png
Rest_1.png
Rest_2.png
Rest_3.png
Cevapla
#18
(31-05-2018, Saat: 00:00)Paranoyaq Adlı Kullanıcıdan Alıntı:
function DoLogin(const username,email,url,comment: string): string;
var
IdHTTP: TIdHTTP;
Request: TStringList;
begin
try
 Request := TStringList.Create;
 try
   Request.Add('action=do_login');
   Request.Add('url=https://www.oyunkabini.com/battlefield-v-ilk-fragmanini-yayinladi-ve-daha-fazlasi-dlc-premium-passes/');
   Request.Add('submit=727');
   Request.Add('author='+username);
   Request.Add('email='+email);
   Request.Add('url='+url);
   Request.Add('comment='+comment);
   Request.Add('submit');
   IdHTTP := TIdHTTP.Create;
   try
     IdHTTP.AllowCookies := True;
     IdHTTP.HandleRedirects := True;
     IdHTTP.Request.ContentType := 'application/x-www-form-urlencoded';
     IdHTTP.Post('https://www.oyunkabini.com/wp-comments-post.php', Request);
     Result := IdHTTP.Get('http://www.oyunkabini.com');
     if StrUtils.ContainsStr(Result, 'submit') then //Login başarısız demektir
       Result := '';
   finally
     IdHTTP.Free;
   end;
 finally
   Request.Free;
 end;
finally
 Result := '';
end;
end;

except yerine finally

buton kodum 
memo2.Lines.Add(DoLogin(edit1.Text,edit2.Text,edit3.Text,memo1.Text));

Hata Could Not Load SSL library

Her hâlükârda (finally'de yazıldığı için) Result := '' olacaksa bu fonksiyonu ne amaçla kullanıyorsunuz?
Ayrıca
if StrUtils.ContainsStr(Result, 'submit') then //Login başarısız demektir
Login olduktan sonra ilgili web sitesi içinde submit kelimesinin geçip geçmediğini kontrol ediyorsunuz. Bu koddan emin misiniz? 
Login olmazsanız sayfada submit kelimesi var ama login olursanız sayfada hiç submit kelimesi geçmiyor olmalı ki yaptığınız bu kontrol işe yarasın.
There's no place like 127.0.0.1
WWW
Cevapla
#19
@SimaWB
submit ve result olayını kaldırdım , submit olayını hiç ayrıntılı düşünmemiştim teşekkürler .
@Cyber
Anlatım için sağol Copy kısmında purchase hatası alıyorum copy yapamıyorum , rest debuggeri @"Fesih ARSLAN" ın http://www.delphican.com/rest-debugger-uygulamsi.html konusundan indirdim
Cevapla


Konu ile Alakalı Benzer Konular
Konular Yazar Yorumlar Okunma Son Yorum
  Delphi 7 Unrar mcuyan 12 485 19-03-2024, Saat: 10:30
Son Yorum: frmman
Lightbulb Delphi 7zip Password lü Dosya Sıkıştırma ve Açma + Bonus RAR5 Desteği frmman 6 262 16-03-2024, Saat: 17:55
Son Yorum: delphi.developer
  delphi 12 ile TFileStream çalışmıyor aegean 5 425 05-03-2024, Saat: 22:23
Son Yorum: aegean
  Delphi ile geliştirdiğiniz uygulamalar neler? - İki Ödüllü Mr.Developer 20 12.683 01-01-2024, Saat: 22:46
Son Yorum: aegean
  Delphi 7 ye göre MB Döviz kurları nasıl alırız maydin60 7 964 31-12-2023, Saat: 02:18
Son Yorum: maydin60



Konuyu Okuyanlar: 1 Ziyaretçi