Welcome, Guest. Please login or register.
Did you miss your activation email?
Pages: [1]   Go Down
  Print  
Author Topic: Check hostname IP  (Read 1282 times)
0 Members and 1 Guest are viewing this topic.
Arkie
Javaforums.net Admin
Senior Member
*

Reputation: 16
Developer @ Javaforums.net
Offline Offline
Posts: 2593
Referrals: 13

WWW Awards
« on: June 04, 2007, 06:32:31 AM »

This little application enables you to lookup hostname's. The corresponding IP will be displayed.

// file name IpCheck.java

Code
GeSHi (java):
  1. public class IpCheck {
  2. public static void main(String[] args)throws java.net.UnknownHostException {
  3.  
  4. String yourURL = "localhost";
  5. /* System.out.println("Name / Ip adress: " + java.net.InetAddress.getByName(args[1])); */
  6. System.out.println("Name / Ip adress: " + java.net.InetAddress.getByName(yourURL));
  7.  
  8. }
  9.  
  10. }
  11.  
Created by GeSHI 1.0.7.20

Screenshot:
http://img472.imageshack.us/img472/4784/ipjr8.png
Check hostname IP
Logged

Java and .NET developer

To students: It doesn't matter how hard you've studied; the material won't be on the exam anyway.

Fan of http://www.retardedweblogger.com
Oh man, too much stuff to do in so little time.

http://img222.imageshack....707/arkietomatoesmall.jpg
Blizzcon 2k9 Grubby and Cassandra Ng engaged ! <3
Triple D, eerste Denken Dan Doen
Pages: [1]   Go Up
  Print  
 
Jump to:  

Your Ad Here