IP address

This is a discussion on IP address within the C Programming forums, part of the General Programming Boards category; hello guys, pls...pls...and pls help me to get the IP number of a PC. its very necessary for me to ...

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    22

    Thumbs up IP address

    hello guys,

    pls...pls...and pls help me to get the IP number of a PC.
    its very necessary for me to detect it, but i don't know the procedure.
    i want to detect any computer's (it can be under network connection or a stand alone PC) IP address.
    pls help me.

    am using Turbo C editor and its compiler.
    my OS is Windows 98,2000 and NT.

    thanx...
    take care...
    Jackie

  2. #2
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,220
    On win 9x:
    start|run| winipcfg

    On win nt/2k:
    start|run| cmd
    >ipconfig

  3. #3
    Registered User
    Join Date
    Oct 2001
    Posts
    22

    Thumbs up IP ADDRESS...

    sorry, i want to detect it by my Turbo C program.
    its very important for me.
    any idea or suggestion or hint or code for Turbo C compatible will be highly appreciated.
    pls help me.

    i want exactly that, at the starting point of my prog, it will first detect and pick the IP address of the current PC or terminal, then that prog will run.

    thanx...
    take care...
    Jackie

  4. #4
    B26354 Deckard's Avatar
    Join Date
    Jan 2002
    Posts
    633
    Jackie,

    Are you interested in determining the IP address of the machine that has connected to your program, or do invision your application monitoring all IP connections on the system?
    Jason Deckard

  5. #5
    Registered User
    Join Date
    Oct 2001
    Posts
    22

    Thumbs up yes...

    deckard,

    u got my point.
    i want exactly what u said.

    thanx...
    take care...
    Jackie

  6. #6
    5|-|1+|-|34|) ober's Avatar
    Join Date
    Aug 2001
    Posts
    4,429
    umm... he asked you a question with 2, count em 2, possible answers there...

  7. #7
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    As you are on the windows platform, you would be better off getting a windows compiler and reading the hundreds of Winsock threads on this board as a starter

  8. #8
    Registered User
    Join Date
    Oct 2001
    Posts
    22

    Thumbs up IP address...

    guys,

    i only want to know that, when my program is running in a machine, my prog how can pick that machine's IP address.

    it is my prog's part to detect its PC's IP whether it is an end-user PC or network connected. it should get that number at the beggining of the prog everytime.

    fordy and others, am using Turbo C and its compiler and i have not any desire of using any win compiler.

    pls give me a solution or any kind of idea.

    thanx...
    take care...
    Last edited by Jackie; 03-13-2002 at 07:40 PM.
    Jackie

  9. #9
    Registered User rohit's Avatar
    Join Date
    Feb 2002
    Posts
    69
    for a program to connect to your machine there must be some port that it must be listening on ... if you know the port nos


    use socket program set interface card to promiscuous mode and read the packets or do recvfrom this will fill the buffer and use inet_ntoa to know the ip there from

    read beej guide to network programming

  10. #10
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    fordy and others, am using Turbo C and its compiler and i have not any desire of using any win compiler.

    Your choice, but as you are programming on the windows platform and you want a service that could so easily be provided by the winsock API you may be making life hard for yourself......and as you can get DevC++ for free....there's no cost implementation

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linux raw socket programming
    By cnb in forum Networking/Device Communication
    Replies: 17
    Last Post: 11-08-2010, 07:56 AM
  2. What does this do (Windows API)?
    By EVOEx in forum Windows Programming
    Replies: 4
    Last Post: 12-19-2008, 09:48 AM
  3. DX - CreateDevice - D3DERR_INVALIDCALL
    By Tonto in forum Game Programming
    Replies: 3
    Last Post: 12-01-2006, 06:17 PM
  4. Identify dynamic IP address of network device
    By BobS0327 in forum Tech Board
    Replies: 2
    Last Post: 02-21-2006, 12:49 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21