Jump to content
Sign in to follow this  

Compare IPaddresses

Recommended Posts


where is the problem? Just compare the numbers.

So long,


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post

Link to post
Share on other sites

I guess I can do single IP's but wasn't sure how to do a range if it was possible.

im doing the exact same thing.

without giving you my source (which is being used in a bigger project), the way i went about it was;

1) split @ipaddress1 into four different variables (i put them into an array)

you can do this with a for..then loop and stringmid()

2) big 'if..then' or 'case..select' blocks to determine where the user is running the program from


if $octetarray[0]="10" then

if $octetarray[1]="56" then

if $octetarray[2]="62" then $location = "... Area Office"

and for subnetting where more than one network is on the one c class (ie. network 1 is, network 2 is

if $octetarray[3]=>96 AND $octetarray[3]=<126 then $location="... District"

if $octetarray[3]=>160 AND $octetarray[3]=<174 then $location="... Campus"

hope this helps..

Edited by logik

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...