<%-- Document : index Created on : Feb 24, 2009, 9:58:30 AM Author : onder --%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@page import="java.net.*"%> <%@page import="java.util.*"%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Godoro Test</title> </head> <body> <h2>Local Internet Address</h2> <%{%> <% InetAddress address=InetAddress.getLocalHost(); %> İnternet Adresi (Internet Address): <%=address%><br/> Konakçı Adı (Host Name) : <%=address.getHostName()%><br/> Kurallı Konakçı Adı (Canonical Host Name) : <%=address.getCanonicalHostName() %><br/> Konakçı Adresi (Host Address) : <%=address.getHostAddress()%><br/> <%}%> <%{%> <h2>Local Host Internet Addresses</h2> <% InetAddress[] addresses=InetAddress.getAllByName("localhost"); %> Address Count : <%=addresses.length%><br><br> <% for(InetAddress address : addresses){ %> InetAddress : <%=address%><br/> Host Name : <%=address.getHostName()%><br/> Canonical Host Name : <%=address.getCanonicalHostName() %><br/> Host Address : <%=address.getHostAddress()%><br/> <%}%> <%}%> <%{%> <h2>Local Network Interface Addresses</h2> <% Enumeration<NetworkInterface> networkInterfaces=NetworkInterface.getNetworkInterfaces(); while(networkInterfaces.hasMoreElements()){ NetworkInterface networkInterface=networkInterfaces.nextElement(); Enumeration<InetAddress> addresses=networkInterface.getInetAddresses(); while(addresses.hasMoreElements()){ InetAddress address=addresses.nextElement(); %> <hr/> Local IP ? : <%=(address.getHostAddress().equals("127.0.0.1"))?"true":"false"%><br/> IP Version 4 ? : <%=(address instanceof Inet4Address)?"true":"false"%><br/> InetAddress : <%=address%><br/> Host Name : <%=address.getHostName()%><br/> Canonical Host Name : <%=address.getCanonicalHostName() %><br/> Host Address : <%=address.getHostAddress()%><br/> <%}%> <%}%> <%}%> <h2>Local Virtual Machine Properties</h2> <%{%> <% Properties properties=System.getProperties(); Iterator keys=properties.keySet().iterator(); while(keys.hasNext()){ String key=(String)keys.next(); String value=properties.getProperty(key); %> <b> <%=key%></b> : <i><%=value%></i><br/> <% } %> <%}%> </body> </html>Dosyayı İndir