Today in this i m providing you an API using which u can get the IP address of the system in which this API will be executed.
Let me provide you the API below is the link provided
Download Here
Lets begin with the programming
- Import this JAR file in your project. I am using NetBeans to develop my demo code. Steps are provided to import API in your code using NetBeans
- Right click on your project name present on left Pane of Netbeans (Under which you have your .java files etc.
- Select Properties, in the Project Properties Frame select Libraries on left pane
- Click on Add Jar/Folder and select the above JAR file
- You are done with importing API in your project
- Now comes the coding part, let me give a brief information about the code
- In this code an object of class GetIPAddress is created
- Using process() of GetIPAddress class IP address is extracted and printed
- Below is the code
- The output of this code is given below i have intentionally not provided my IP address :P
- Congrats you just got your IP address using your own code :)
Thats it for this post
Take Care
Peace
For Any Query mail me: ravjot.singh.28@gmail.com