/** // <Summary>
/// Make sure that the ending IP address is greater than the starting IP Address
/// </Summary>
Private bool validateip (string startip, string endip)
...{
// Separate the four digits in the IP address
String [] startiparray = startip. Split ('.');
String [] endiparray = endip. Split ('.');
// Obtain the numbers
Long [] startipnum = new long [4];
Long [] endipnum = new long [4];
For (INT I = 0; I <4; I ++)
...{
Startipnum [I] = long. parse (startiparray [I]. Trim ());
Endipnum [I] = long. parse (endiparray [I]. Trim ());
}
// Multiply the numbers by the corresponding order of magnitude
Long startipnumtotal = startipnum [0] * 256*256*256 + startipnum [1] * 256*256 + startipnum [2] * 256 + startipnum [3];
Long endipnumtotal = endipnum [0] * 256*256*256 + endipnum [1] * 256*256 + endipnum [2] * 256 + endipnum [3];
If (startipnumtotal> endipnumtotal)
...{
Return false;
}
Else
...{
Return true;
}
}