Autor Beitrag
Sauger Chris
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 228

Win XP, Linux SuSE 9.2
Delphi 4,Delphi 7 Ent.
BeitragVerfasst: Sa 28.07.07 12:57 
moin


und zwar würde mich mal interessieren wie man mit threads arbeitet
und wie der source so aus sieht.


sagen wir mal ich will einen port scanner coden der durch die threads die geschwindigkeit
des scanners steuert


ich hab null plan wie ich das realisieren soll / könnte hoffe ihr wisst was ich überhaupt von euch will , brauch :)

ps. ich bin für alles dankbar (tutorials, source code)


danke
sauger chris
alzaimar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2889
Erhaltene Danke: 13

W2000, XP
D6E, BDS2006A, DevExpress
BeitragVerfasst: Sa 28.07.07 15:36 
Schon mal in den Demos von Delphi nachgeschaut?

_________________
Na denn, dann. Bis dann, denn.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Sa 28.07.07 18:54 
Oder schon mal die Suchfunktion hier im Forum bemüht?

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Sa 28.07.07 21:07 
Es gibt hier im Forum sogar ein Tutorial dazu...
Such einfach mal unter Tutorials in der Library...
Sauger Chris Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 228

Win XP, Linux SuSE 9.2
Delphi 4,Delphi 7 Ent.
BeitragVerfasst: So 29.07.07 17:23 
so also hab mir jetzt mal n paar tutorials durch gelesen

aber irgend wie komm ich nicht weiter :(

und zwar möchte ich mit der indy kom. idhttp
ein http request mit 3 threads starten

in der listbox1 komp. steht drin

/chat/index.php
/chat/log.txt
/chat/user.txt

in listbox2 kommen die ergebnise
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
function UrlCheck(sUrl: String; bAllowRedirects: Boolean = false): Integer; //funktion zum ResponseCode abrufen
begin
  with TidHTTP.Create(nil) do
  try
    try
      HandleRedirects := bAllowRedirects;
      Head(sUrl);
      Result := Response.ResponseCode;
    finally
      Free;
    end;
  except
      Result := GetLastError;
  end;
end;
////////////////////////////////////////////////////////////////////////////////////////////
//Aufruf:
if UrlCheck('http://192.168.0.199' + listbox1.Items.Strings[listbox1.itemindex] , true) = 200 then  // request code 200 also datei vorhanden
begin
  listbox2.Items.Add('http://192.168.0.199' + listbox1.Items.Strings[listbox1.itemindex] + ' <--- [Datei ist da]');
 end
 else
  listbox2.Items.Add('http://'+ edit1.text + listbox1.Items.Strings[listbox1.itemindex] + ' ---> [Sorry datei nicht online]');
  listbox2.ItemIndex:=Listbox2.Items.Count-1;
except
  listbox1.Selected[0] := true;


ps. ich weiß nicht wie ich das jetzt so coden soll das das ganze mit threads läuft
sitz hier seit n paar stunden rum aber es kommt nix brauchbares bei raus vieleicht kann mir einer von euch helfen
das ich das mit den threads besser verstehe und ein paar beispiele geben wie ich am besten anfange.


ich danke euch

mfg chris
alzaimar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2889
Erhaltene Danke: 13

W2000, XP
D6E, BDS2006A, DevExpress
BeitragVerfasst: So 29.07.07 18:45 
1. Du kennst Klassen?
2. Du kennst Vererbung?
3. Du weisst, was eine überschriebene (override) Methode ist?

Überschreibe die Execute-Methode, so wie in den Delphi-Demos mit deinem Code und sieh nach, was passiert. Achte darauf, das sämtliche Ausgaben über die Synchronize-Methode des Threads ausgeführt werden müssen. Auch das sieht man in den Demos und dem Tutorial.

_________________
Na denn, dann. Bis dann, denn.