首页 > 移动平台 > 详细

bsh for android : Inet 地址 Test

时间:2014-04-05 22:33:26      阅读:586      评论:0      收藏:0      [点我收藏+]

beanshell : InetAddressTest.bsh

source("/sdcard/com.googlecode.bshforandroid/extras/bsh/android.bsh");
a = Android();

urlName = a.call("dialogGetInput","Inet Address Test","Input URL:").get("result");
print(urlName);
try {
   if (urlName != null){  
      String host = urlName;
      InetAddress[] addresses = InetAddress.getAllByName(host);
      for (InetAddress a : addresses)
         print(a);
   }
   else {  
      InetAddress localHostAddress = InetAddress.getLocalHost();
      print(localHostAddress);
   }
} catch (Exception e){  
   print(e);
}

参考: Core Java 2 Volume II ( 7th Edition)  v2ch3

bsh for android : Inet 地址 Test,布布扣,bubuko.com

bsh for android : Inet 地址 Test

原文:http://blog.csdn.net/belldeep/article/details/22982801

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!