IP Conversion Program
Results 1 to 8 of 8

Thread: IP Conversion Program

  1. #1
    Avatar Goes Here Radical Dreamer's Avatar
    Join Date
    Jan 2001
    Location
    Fairmont, West Virginia
    Posts
    4,866

    IP Conversion Program

    I am looking to find a way to write a program that will convert an IP address to binary and vice versa, can anyone give me a place to start? I can do it in either C++ or VB, but I prefer VB
    :::Asus A8N-Sli Premium:::AMD 3500+ @ 2.4ghz:::2x80GB 8mb cache RAID0 Array:::GeForce 7800GTX OC:::2GB Corsair XMS Memory:::500 Watt Enermax Liberty PSU:::16x Lite-on DVDRW:::

    Counter Strike Source Forum and Server @ http://www.nvpclan.com -=Ninjas Vs. Pirates=-

  2. #2
    Registered User
    Join Date
    Oct 2000
    Posts
    1,569
    here is an explanation of what you need to do...not sure if this is what you want:

    binary converter

  3. #3
    Avatar Goes Here Radical Dreamer's Avatar
    Join Date
    Jan 2001
    Location
    Fairmont, West Virginia
    Posts
    4,866
    Not entirely, but definately helps!
    :::Asus A8N-Sli Premium:::AMD 3500+ @ 2.4ghz:::2x80GB 8mb cache RAID0 Array:::GeForce 7800GTX OC:::2GB Corsair XMS Memory:::500 Watt Enermax Liberty PSU:::16x Lite-on DVDRW:::

    Counter Strike Source Forum and Server @ http://www.nvpclan.com -=Ninjas Vs. Pirates=-

  4. #4
    Registered User
    Join Date
    Oct 2000
    Posts
    1,569
    ok...how about a VB function?

    dec2bin

  5. #5
    Avatar Goes Here Radical Dreamer's Avatar
    Join Date
    Jan 2001
    Location
    Fairmont, West Virginia
    Posts
    4,866
    Looks good to me, will try it soon as I get the chance
    :::Asus A8N-Sli Premium:::AMD 3500+ @ 2.4ghz:::2x80GB 8mb cache RAID0 Array:::GeForce 7800GTX OC:::2GB Corsair XMS Memory:::500 Watt Enermax Liberty PSU:::16x Lite-on DVDRW:::

    Counter Strike Source Forum and Server @ http://www.nvpclan.com -=Ninjas Vs. Pirates=-

  6. #6
    Registered User kingtbone's Avatar
    Join Date
    May 2001
    Location
    Freddy Beach
    Posts
    794
    Yeah that numbver converter looks fine. Now I guess you just have to parse up the string by the "." marks. It woulda been more fun to make our own
    Hard work often pays off in the long run, but Lazyness always pays off now.

  7. #7
    Avatar Goes Here Radical Dreamer's Avatar
    Join Date
    Jan 2001
    Location
    Fairmont, West Virginia
    Posts
    4,866
    Not when you have 12 different programming projects to do in 2 weeks
    :::Asus A8N-Sli Premium:::AMD 3500+ @ 2.4ghz:::2x80GB 8mb cache RAID0 Array:::GeForce 7800GTX OC:::2GB Corsair XMS Memory:::500 Watt Enermax Liberty PSU:::16x Lite-on DVDRW:::

    Counter Strike Source Forum and Server @ http://www.nvpclan.com -=Ninjas Vs. Pirates=-

  8. #8
    Registered User
    Join Date
    Dec 2000
    Location
    Circle Pines,MN,USA
    Posts
    805
    Well....you could just ingore all math functions for a problem like this.. although its not the most effeciant method.. you can use all strings for this exercise.

    you know how to add strings I am assuming..

    When your program loads.. inflate two seperate arrays[255] each with 2 different values of strings.(you can do this the hard way or programatically)

    Index Array1 Array2
    0 "0" "00000000"
    1 "1" "00000001"
    2 "2" "00000010"
    N.......

    and so on.. when you need to convert from dec to bin.. simply compare the string array with the one you've parsed out.... when you match stop there.. your index is the one that contains the binary string! then visa versa.

    if you run into a snag with the parse code let us know.

Bookmarks

Posting Permissions

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