Results 1 to 16 of 16

Thread: Change IP in VB 2005

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2007
    Posts
    18

    Change IP in VB 2005

    I'm still new to VB 2005. I found the source code I want to use, but it's in VB6. I'm having trouble changing it to VB 2005. Is there a converter that I can use or some to help? Here is a link to the code http://www.msfn.org/board/lofiversio...hp/t70524.html .

    Thanks,
    Tony

  2. #2
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: Change IP in VB 2005

    Could you show us the code so we could possibly convert it... That link does not go exactly to the code.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    May 2007
    Posts
    18

    Re: Change IP in VB 2005

    Sorry, here it is as an attachment....

    vb6code.txt

    Thanks,
    Tony

  4. #4
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Change IP in VB 2005

    1) If you're connected directly to your provider (no router or routing modem), this will break your connection, since the provider won't know your new address.

    2) If you're behind a router there's no need to do it, since your IP isn't visible outside your router.

    3) Loading the file into a new solution should trigger VB.Net's conversion process.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  5. #5

    Thread Starter
    Junior Member
    Join Date
    May 2007
    Posts
    18

    Re: Change IP in VB 2005

    The code does not convert well into VS 2005. That is why I'm asking for help. I'm slowly learning things, but I'm still new to VB.

  6. #6
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: Change IP in VB 2005

    Internet IP addresses are assigned by your ISP. Not by your NIC.

    Changing the IP on a dial up connection usually just means disconnecting and re-connecting to the internet. To change one on a broadband connection requires you to change a byte in one of the last 3 octets of your MAC address on your NIC/router. Then unplug the modem, chord, whatever and plug it back in to reconnect (wouldn't recommend doing this).

    Not sure how that code plans on changing the "IP on the adapter".

  7. #7
    Member
    Join Date
    May 2007
    Posts
    37

    Re: Change IP in VB 2005

    I use some console app written in C which you just provide a MAC address of your choice as usage and click enter it would set a new GUID in registry editing your MAC Address than it would reconnect your networking (killing off your internet) for like 30 seconds than when it reconnects you have a new IP.. It was risky for me to do because first time it didn't reconnect becasue my ISP only allowed my MAC's last XX-XX-XX-(XX) HEX digits to be changed +1/-1 If I over did it I had to call my company or I was stuck without internet.

  8. #8

    Thread Starter
    Junior Member
    Join Date
    May 2007
    Posts
    18

    Re: Change IP in VB 2005

    I'm wanting to write a progarm that will let me change between static ip and dhcp without going thru the windows way. This is for my work and it's to slow.

  9. #9

    Thread Starter
    Junior Member
    Join Date
    May 2007
    Posts
    18

    Re: Change IP in VB 2005

    Can anyone help me with this code?

  10. #10
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Change IP in VB 2005

    Quote Originally Posted by akernan
    I'm wanting to write a progarm that will let me change between static ip and dhcp without going thru the windows way.
    You have to use Windows somehow - you can't access hardware directly after Windows 95.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  11. #11

    Thread Starter
    Junior Member
    Join Date
    May 2007
    Posts
    18

    Re: Change IP in VB 2005

    Can you convert the code for me? It's in VB 6, VS2005 doesn't convert it cleanly.

  12. #12

    Thread Starter
    Junior Member
    Join Date
    May 2007
    Posts
    18

    Re: Change IP in VB 2005

    I guess I need to rephrase. I'm looking for away to change the ip address with a program and not use netsh. I found the code I want to work with but it is in VB6 and does not convert to VS2005 nicely.

    /Rant on /
    Guys I've been in the IT field for 20 yrs, mostly in networking. I don't need a lesson in IP or MAC addresses. I just need help converting this code. If you can convert it, great. It is very much appreciated. If not, let me know. It's no big deal, I'll just go somewhere else and try.
    /Rant Off/

    Sorry if I hurt anybodies feelings or upset anyone with my little rant. You all have been very understanding and helpful with my other questions.

    Thanks,
    Tony

  13. #13
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: Change IP in VB 2005

    Quote Originally Posted by akernan
    I guess I need to rephrase. I'm looking for away to change the ip address with a program and not use netsh. I found the code I want to work with but it is in VB6 and does not convert to VS2005 nicely.

    /Rant on /
    Guys I've been in the IT field for 20 yrs, mostly in networking. I don't need a lesson in IP or MAC addresses. I just need help converting this code. If you can convert it, great. It is very much appreciated. If not, let me know. It's no big deal, I'll just go somewhere else and try.
    /Rant Off/

    Sorry if I hurt anybodies feelings or upset anyone with my little rant. You all have been very understanding and helpful with my other questions.

    Thanks,
    Tony
    It's cool, I understand your frustration. Sometimes it can be hard to get a direct answer to your question without getting replies like mine.

    I don't know .NET but maybe I can work out something. I'll look over it later when I'm not so drunk.

  14. #14

    Thread Starter
    Junior Member
    Join Date
    May 2007
    Posts
    18

    Re: Change IP in VB 2005

    Thanks for trying, that is all that can be asked.

    Tony

  15. #15

    Thread Starter
    Junior Member
    Join Date
    May 2007
    Posts
    18

    Re: Change IP in VB 2005

    Can anyone help to convert this code?

  16. #16
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Change IP in VB 2005

    The conversion is pretty simple - correct the few errors (like changing the Object types to VariantType and 'L = LSet(B) to L = B.B4 + CLng(16) * B.B3 + 256 * B.B2 + 65536 * B.B1.

    The only problem I have is that neither one - VB6 or VB 2005 - changes my IP. I haven't debugged it to find out why.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

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