Main Logo
Articles   Members Online:
-Article/Tip Search
-News Group Search over 800,000 Borland news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
CBuilder: How to get your internet IP address
Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to get your internet IP address Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
works behind a router 07-Jun-05
Category
Internet / Web
Language
CBuilder All Versions
Views
606
User Rating
7
# Votes
1
Replies
0
Publisher:
Biasi, andrea
Reference URL:
Andrea Biasi
			1   
2   //this is an exmaple to show your IP address from a website called
3   //www.whatismyip.com and display the results in Edit box
4   //---------------------------------------------------------------------------
5   
6   #include <vcl.h>
7   #pragma hdrstop
8   
9   #include "Unit1.h"
10  //---------------------------------------------------------------------------
11  #pragma package(smart_init)
12  #pragma resource "*.dfm"
13  TForm1 *Form1;
14  //---------------------------------------------------------------------------
15  __fastcall TForm1::TForm1(TComponent* Owner)
16          : TForm(Owner)
17  {
18  }
19  //---------------------------------------------------------------------------
20  
21  void __fastcall TForm1::Button1Click(TObject *Sender)
22  {
23      TNMHTTP *http = new TNMHTTP(this);
24      //leave the line below alone
25          http->Get("http://www.whatismyip.com");
26  
27          int t = http->Body.AnsiPos("Your IP Is")+11;
28          int l=t;
29          while (http->Body.SubString(l,1)!=" ") l++;
30          Edit1->Text = http->Body.SubString(t,l-t);
31  
32          delete http;
33  }
34  //---------------------------------------------------------------------------


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC
Advertisement


Share this page
Advertisement
Copyright © 2024 by No Limit Solutions LLC