Find your IP Address
Posted October 2, 2010
on:- In: Java | Java Source Code | Java Tutorials
- 2 Comments
Objective :
- How to find IP address of your computer?
- How to find IP address by programming?
- How to find IP address by Java programming?
- Write a Java program to find IP Address.
Hello guys.
Do you want to find your IP Address?
There are following ways to check / find your IP Address
- Using Command prompt.
- Using Programming.
1. Using Command Prompt :
2. Using Programming :
Here we are using a Java Program to find the IP Address. The Java Program to find the IP Address is as follows;
package com.si.java.utility.ip; import java.net.InetAddress; /** * * Language : Java * File : IPAddressFinder.java * Date : Saturday, October 2, 2010 * @author Atul Palandurkar * Email : atul.palandurkar@gmail.com * Website : www.shardainfotech.com * */ public class IPAddressFinder { public static void main(String[] args) { try { InetAddress ia = InetAddress.getLocalHost(); String ip = ia.getHostAddress(); System.out.println("Your IP Address :- "+ip); } catch (Exception ex) { ex.printStackTrace(); } } }
The above code can be very useful to find the IP address of your computer, as well as this can be used to find the IP address of the user in internet based applications with a little change in it.
Use it & have fun.
..
2 Responses to "Find your IP Address"
Comments are closed.
October 5, 2010 at 5:26 PM
Thanks a lot Aatul for this. For many days i was looking for this for my engineering project & i was very much in need of it as i was not getting any clue for how to find the os? Really thanks a lot.
LikeLike
August 23, 2012 at 1:10 AM
Thanks Raj π
LikeLike