// Decompiled by DJ v3.12.12.96 Copyright 2011 Atanas Neshkov  Date: 08/10/2012 8:47:47
// Home Page: http://members.fortunecity.com/neshkov/dj.html http://www.neshkov.com/dj.html - Check often for new version!
// Decompiler options: packimports(3) 
// Source File Name:   GetIp.java

package project;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class GetIp
{

    public GetIp()
    {
    }

    public static void main(String argv[])
    {
        new GetIp();
    }

    public static String GetMyIp()
    {
        String ipAddress = "";
        try
        {
            InetAddress internetHost = null;
            internetHost = InetAddress.getLocalHost();
            byte ipBytes[] = internetHost.getAddress();
            for(int i = 0; i < ipBytes.length; i++)
            {
                if(i > 0)
                    ipAddress = ipAddress + ".";
                ipAddress = ipAddress + (ipBytes[i] & 0xff);
            }

        }
        catch(UnknownHostException e)
        {
            e.printStackTrace();
        }
        return ipAddress;
    }
}