Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi Indy 10 funct anders als Indy 9? (https://www.delphipraxis.net/61641-indy-10-funct-anders-als-indy-9-a.html)

th_bone 26. Jan 2006 20:28

Re: Indy 10 funct anders als Indy 9?
 
Indy9 Bsp funktionieren ohne Ändernungen nicht mit Indy10,
da hier einiges an der CodeBasis und deren Befehlen geändert wurde..

so müsste es gehen:

Delphi-Quellcode:
interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, IdBaseComponent, IdComponent, IdCustomTCPServer, IdTCPServer, idcontext;

type
  TForm1 = class(TForm)
    IdTCPServer1: TIdTCPServer;
    procedure FormCreate(Sender: TObject);
    procedure IdTCPServer1Execute(AContext: TIdContext);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.IdTCPServer1Execute(AContext: TIdContext);
begin
with acontext.Connection.IOHandler do
  begin
    WriteLn('Hello from Basic Indy Server server.');
    idTcpServer1.Active:=false;
  end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  idTCPserver1.Active:=true;
end;

end.
idTCPserver1 <- muß natürlich dem Namen deiner komponente entsprechen

Tschö

Ralf

inherited 11. Feb 2006 11:13

Re: Indy 10 funct anders als Indy 9?
 
Wunderbar bei mir gehts jetzt auch, allerdings hab ich noch Probleme mit dem Client
Delphi-Quellcode:
procedure TForm6.Button1Click(Sender: TObject);
begin
  with IdTCPClient1 do begin
    Connect;
    try
      ListBox1.Items.Add(ReadLn); //Hier mag er das ReadLn nicht
    finally
      Disconnect;
    end;
  end;
end;
hilfee?

Zacherl 11. Feb 2006 12:07

Re: Indy 10 funct anders als Indy 9?
 
Es dürfte IdTCPClient1.IOHandler.ReadLn sein.
Also:

Delphi-Quellcode:
procedure TForm6.Button1Click(Sender: TObject);
begin
  with IdTCPClient1 do begin
    Connect;
    try
      ListBox1.Items.Add(IOHandler.ReadLn); //Hier mag er das ReadLn nicht
    finally
      Disconnect;
    end;
  end;
end;
Florian


Alle Zeitangaben in WEZ +1. Es ist jetzt 13:43 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz