CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2000
    Location
    London England
    Posts
    144

    Changing the Local Machine IP address

    I need to be able to dynamically change the LOCAL MACHINE IP address.

    I can change the name of the local machine in the Windows 2000 Control panel, but i need to be able to change the IP address itself.

    If this requires a hardware alteration, then i need to know what component changes are needed, but if there is anyone who can provide this in C++ or Visual Basic. I would be grateful.

    if anyone knows any means of detecting an outgoing local IP (by way of a breakout box or similar) i would be grateful for that info too.


    Jason.


  2. #2
    Join Date
    Sep 1999
    Location
    NJ
    Posts
    1,299

    Re: Changing the Local Machine IP address

    There is an WIN32 API which was added in Win2000 to get the IP address. It will only work on 2000 and XP.

    Truth,
    James
    http://www.NJTheater.com
    http://www.NovelTheory.com
    I don't do it for the points (OK, maybe I do), but rating a post is a good way for me to know if I helped.

  3. #3
    Join Date
    Sep 2000
    Location
    London England
    Posts
    144

    Re: Changing the Local Machine IP address

    Ok, that only retrieves the Local IP, i can already do that. How to I CHANGE the local IP address??

    Jas



  4. #4
    Join Date
    Sep 1999
    Location
    NJ
    Posts
    1,299

    Re: Changing the Local Machine IP address

    I believe you are looking for the AddIPAddress() api.
    http://msdn.microsoft.com/library/de...dipaddress.asp


    Truth,
    James
    http://www.NJTheater.com
    http://www.NovelTheory.com
    I don't do it for the points (OK, maybe I do), but rating a post is a good way for me to know if I helped.

  5. #5
    Join Date
    Feb 2001
    Posts
    13

    Re: Changing the Local Machine IP address

    Remarks
    The IP address created by AddIPAddress is not persistent. The address exists only as long as the adapter object exists. Restarting the computer destroys the address, as does manually resetting the network interface card (NIC). Also, certain PnP events may destroy the address.




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured