Ip Connection - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Ip Connection

Hey, can anyone connect to another pc through an ip address? I am trying to connect to one of my other pc's, and do anything, but all i need is a delphi code on how to do it...

Thanx

Comments

  • zibadianzibadian Posts: 6,349Member
    : Hey, can anyone connect to another pc through an ip address? I am trying to connect to one of my other pc's, and do anything, but all i need is a delphi code on how to do it...
    :
    : Thanx
    :
    That depends on which protocol you want to use. If you want to ftp, then you can use the TNMFtp of TidFTP components. If you want to design a custom protocol, then the TSocketCleitn/TSocketServer components are a better way.
  • edomingos_jredomingos_jr Posts: 83Member
    Yes, i understand I must use those, but then, what is the code to be used, and where can I find those components?


    thanx
  • zibadianzibadian Posts: 6,349Member
    : Yes, i understand I must use those, but then, what is the code to be used, and where can I find those components?
    :
    :
    : thanx
    :
    You can find the Indy components at www.google.com. The code is very dependant on what you want to accomplish. Here is a client sample code based on the Echo protocol:
    [code]
    procedure TForm1.Button1Click(Sender: TObject);
    begin
    IdEcho1.Host := Edit1.Text;
    IdEcho1.Connect;
    if IdEcho1.Echo('hello world') = 'hello world' then
    Button1.Caption := IntToStr(IdEcho1.EchoTime);
    IdEcho1.Disconnect;
    end;
    [/code]
    The code for the EchoServer is even easier:
    [code]
    procedure TForm1.Button1Click(Sender: TObject);
    begin
    IdEchoServer1.Active := not IdEchoServer1.Active;
    end;
    [/code]
    While the Echo prototcol is not very useful in most applications, it is great for debugging and testing. Without knowing for what the connection is made, this is the best help I can give you.
  • edomingos_jredomingos_jr Posts: 83Member
    The code works perfectly, but it tells me that I dont have the permission to access that particular ip. how can i fix this? I even tried with the computer on the network, but it didnt work. Anyways am I supposed to get permission? How does a person give permission? IDoes it give permission to an ip address? If so, then ehat if i use that same software in another pc???

    Thanx...
Sign In or Register to comment.