Archive

Posts Tagged ‘IP’

Usage Details on DD-WRT Router

February 4th, 2014 11 comments

I’ve been looking for a while for a simple way to add usage statistics of all IPs on my network, so I can see which PC / User is using all the bandwidth.

This project on code.google

This example was done on my router a ASUS RT-N16
Firmware Version: DD-WRT v24-sp2 (11/21/10) big (SVN revision 15778)

Continue reading “Usage Details on DD-WRT Router” »

Validate IPv4 Address

May 9th, 2011 1 comment

I’ve been looking for a very simple way to validate IPv4 addresses entered into a textbox. There are quite a few options I found, but none that really suited the simple functionality I was after.

This is the code snippet of what I have implemented:

public static bool CheckIpAddress(string addressIp)
{
    try
    {
        string[] splitIp = addressIp.Split('.');

        if (splitIp.Length != 4)
        {
            return false;
        }

        if (splitIp.Select(Int32.Parse).Any(result => result < 0 || 
                                                      result > 255))
        {
            return false;
        }
    }
    catch (Exception)
    {
        return false;
    }
    return true;
}
%d bloggers like this: