Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IP numbers
Message
From
22/04/2011 12:19:59
 
 
To
22/04/2011 09:01:34
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01508084
Message ID:
01508136
Views:
48
>>I've been trying to use incrementing ip numbers to access the web.
>>Here's a bit of code with which I've been noodling.
>>
>>
>>A = 75
>>B = 124
>>C = 92
>>D = 71
>>D = D + 1
>>IF D > 255
>>D = 1
>>C = C + 1
>>ENDIF
>>IF C > 255
>>C = 1"
>>B = B + 1
>>ENDIF
>>IF B > 255
>>B = 1
>>A = A + 1
>>ENDIF
>>IF A > 255
>>QUIT
>>ENDIF
>>IPOutput = "HTTP://" + A + "." + B + "." + C + "." + D
>>IPOutput = ALLTRIM(IPOutput)
>>
>>
>>I'm trying to mix numbers and strings to come up with a working IP. Any ideas? or solutions? appreciated.
>
>Of course in the concatenation (the second-last line), numbers must be converted to text - I suggest transform(A) + ... for simplicity.
>
>If you replace A, B, C, D with a single array, you can replace several IF structures with a single loop (plus a final exit condition).
>
>Please note that the entire range of addresses is quite large - 2^32, or about 4.3 billion addresses. That is, if you go ahead and generate ALL IP addresses, it will take quite a while.
>
>Also, out of these addresses, some are not usable. Mainly, the entire Class D and Class E range are not used to access individual computers. (Class D is used for multicasting, Class E is reserved for experimental purposes.) That makes the upper limit for usable IP addresses 223.255.255.255.

Thanks Hilmar. Any word on the B'hai people in Iran lately? I read up on it and it seems that they have more rights to be there than Islam. It's a strange world.
I ain't skeert of nuttin eh?
Yikes! What was that?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform