September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -0,0 +1,27 @@
// version 1.1.3
import java.net.InetAddress
import java.net.Inet4Address
import java.net.Inet6Address
fun showIPAddresses(host: String) {
try {
val ipas = InetAddress.getAllByName(host)
println("The IP address(es) for '$host' is/are:\n")
for (ipa in ipas) {
print(when (ipa) {
is Inet4Address -> " ipv4 : "
is Inet6Address -> " ipv6 : "
else -> " ipv? : "
})
println(ipa.hostAddress)
}
}
catch (ex: Exception) {
println(ex.message)
}
}
fun main(args: Array<String>) {
showIPAddresses("www.kame.net")
}