-
August 28th, 2002, 07:00 PM
#1
Avatar Goes Here
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=-
-
August 28th, 2002, 07:52 PM
#2
here is an explanation of what you need to do...not sure if this is what you want:
binary converter
-
August 28th, 2002, 09:45 PM
#3
Avatar Goes Here
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=-
-
August 28th, 2002, 10:13 PM
#4
ok...how about a VB function?
dec2bin
-
August 29th, 2002, 10:01 AM
#5
Avatar Goes Here
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=-
-
August 29th, 2002, 11:47 AM
#6
Registered User
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.
-
September 1st, 2002, 11:22 PM
#7
Avatar Goes Here
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=-
-
September 4th, 2002, 09:47 AM
#8
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|
Bookmarks