日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > Android >内容正文

Android

Android 获取本地外网IP、内网IP、计算机名等信息

發(fā)布時(shí)間:2024/8/23 Android 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Android 获取本地外网IP、内网IP、计算机名等信息 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

一、獲取本地外網(wǎng)IP

  • public static String GetNetIp()
  • ? ? ? ? {
  • ? ? ? ?? ???URL infoUrl = null;
  • ? ? ? ?? ???InputStream inStream = null;
  • ? ? ? ?? ???try
  • ? ? ? ?? ???{
  • ? ? ? ?? ???? ? ? ? //http://iframe.ip138.com/ic.asp
  • ? ? ? ?? ?? ?? ?//infoUrl = new URL("http://city.ip138.com/city0.asp");
  • ? ? ? ?? ?? ?? ?infoUrl = new URL("http://iframe.ip138.com/ic.asp");
  • ? ? ? ?? ?? ?? ?URLConnection connection = infoUrl.openConnection();
  • ? ? ? ?? ?? ?? ?HttpURLConnection httpConnection = (HttpURLConnection)connection;
  • ? ? ? ?? ?? ?? ?int responseCode = httpConnection.getResponseCode();
  • ? ? ? ?? ?? ?? ?if(responseCode == HttpURLConnection.HTTP_OK)
  • ? ? ? ?? ?? ?? ?{
  • ? ? ? ?? ?? ?? ?? ? inStream = httpConnection.getInputStream();
  • ? ? ? ?? ?? ?? ?? ? BufferedReader reader = new BufferedReader(new InputStreamReader(inStream,"utf-8"));
  • ? ? ? ?? ?? ?? ?? ? StringBuilder strber = new StringBuilder();
  • ? ? ? ?? ?? ?? ?? ? String line = null;
  • ? ? ? ?? ?? ?? ?? ? while ((line = reader.readLine()) != null)
  • ? ? ? ?? ?? ?? ?? ?? ???strber.append(line + "\n");
  • ? ? ? ?? ?? ?? ?? ? inStream.close();
  • ? ? ? ?? ?? ?? ?? ? //從反饋的結(jié)果中提取出IP地址
  • ? ? ? ?? ?? ?? ?? ? int start = strber.indexOf("[");
  • ? ? ? ?? ?? ?? ?? ? int end = strber.indexOf("]", start + 1);
  • ? ? ? ?? ?? ?? ?? ? line = strber.substring(start + 1, end);
  • ? ? ? ?? ?? ?? ?? ? return line;
  • ? ? ? ?? ?? ?? ?}
  • ? ? ? ?? ???}
  • ? ? ? ?? ???catch(MalformedURLException e) {
  • ? ? ? ?? ?? ?? ?e.printStackTrace();
  • ? ? ? ?? ???}
  • ? ? ? ?? ???catch (IOException e) {
  • ? ? ? ?? ?? ?? ?e.printStackTrace();
  • ? ? ? ?? ???}
  • ? ? ? ?? ???return null;
  • ? ? ? ? }
  • 二、 獲取本地內(nèi)網(wǎng)IP

  • // 獲取本地IP函數(shù)
  • ? ? ? ? ? ? ? ? public static String getLocalIPAddress() {
  • ? ? ? ? ? ? ? ? ? ? ? ? try {
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? for (Enumeration<NetworkInterface> mEnumeration = NetworkInterface
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? .getNetworkInterfaces(); mEnumeration.hasMoreElements();) {
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? NetworkInterface intf = mEnumeration.nextElement();
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? for (Enumeration<InetAddress> enumIPAddr = intf
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? .getInetAddresses(); enumIPAddr.hasMoreElements();) {
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? InetAddress inetAddress = enumIPAddr.nextElement();
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? // 如果不是回環(huán)地址
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if (!inetAddress.isLoopbackAddress()) {
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? // 直接返回本地IP地址
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? return inetAddress.getHostAddress().toString();
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
  • ? ? ? ? ? ? ? ? ? ? ? ? } catch (SocketException ex) {
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? System.err.print("error");
  • ? ? ? ? ? ? ? ? ? ? ? ? }
  • ? ? ? ? ? ? ? ? ? ? ? ? return null;
  • ? ? ? ? ? ? ? ? }
  • 三、 獲取本地外網(wǎng)IP、內(nèi)網(wǎng)IP、計(jì)算機(jī)名等信息

  • /**
  • *功能: 獲取外網(wǎng)IP,內(nèi)網(wǎng)IP,計(jì)算機(jī)名等信息;
  • *
  • *作者: jef
  • *
  • *時(shí)間: 20100714
  • *
  • *版本: v1.0.0
  • *
  • *
  • *程序說明:
  • *??? ? ? ? 通過純真網(wǎng)絡(luò)來獲取IP,因?yàn)閕p138網(wǎng)站有時(shí)不準(zhǔn)。
  • *??
  • *??? ? ? ? 運(yùn)行程序時(shí)命令行參數(shù)請(qǐng)輸入http://www.cz88.net/ip/viewip778.aspx
  • *??? ? ? ? 等待程序運(yùn)行完畢(執(zhí)行時(shí)間視網(wǎng)絡(luò)情況而定),會(huì)在程序目錄下生成一個(gè)GETIP.sys文件來輸出各參數(shù)。
  • *??
  • *??? ? ? ? 運(yùn)行時(shí)如果不輸入命令行參數(shù),則默認(rèn)使用http://www.cz88.net/ip/viewip778.aspx來獲取IP。
  • *??
  • *??? ? ? ? 注意,
  • *??? ? ? ? 不輸入命令行參數(shù)時(shí)獲取的信息會(huì)輸出到命令行,不會(huì)輸出到文件。
  • *??? ? ? ? 輸入命令行參數(shù)時(shí)獲取的信息則會(huì)輸出到文件,不管獲取IP成功與否。
  • *??
  • *??? ? ? ? 輸出信息部分內(nèi)容的含義如下,
  • *??? ? ? ? sucess
  • *??? ? ? ? hostName is:MyPC
  • *??? ? ? ? hostAddr is:192.168.1.114
  • * ? ? ? ? ? ? ? ? Foreign IP is:210.72.100.9
  • *??? ? ? ? Location is:江蘇省蘇州 長(zhǎng)城寬帶
  • *??? ? ? ? ......
  • *??
  • *??? ? ? ? 第一行表示全部過程成功與否。成功輸出"sucess",否則"fail",
  • *??? ? ? ? 第二行表示計(jì)算機(jī)名,
  • *??? ? ? ? 第三行表示內(nèi)網(wǎng)IP,
  • *??? ? ? ? 第四行表示外網(wǎng)IP,
  • *??? ? ? ? 第五行表示外網(wǎng)IP所有的可能地理位置(可信度依賴于查詢的網(wǎng)站)。
  • *??? ? ? ? ......
  • *??
  • *??
  • *使用舉例:
  • *? ?? ? ? ? 拷貝 \cn\mail\sendback\GetIP.class 文件到C:\Documents and Settings下。注意要保留包名的目錄。
  • *? ?? ? ? ? 打開命令提示行窗口,輸入:
  • *? ?
  • *? ?? ? ? ? c:
  • *? ?? ? ? ? cd C:\Documents and Settings
  • *? ?? ? ? ? java cn.mail.sendback.GetIP http://www.cz88.net/ip/viewip778.aspx
  • *? ?
  • *? ?? ? ? ? 等待C:\Documents and Settings目錄下出現(xiàn)GETIP.sys文件則表示執(zhí)行完畢,
  • *? ?? ? ? ? 用記事本打開該文件。含義見說明部分。
  • *? ?
  • */


  • package com.soai.test;

  • import java.io.BufferedReader;
  • import java.io.BufferedWriter;
  • import java.io.FileNotFoundException;
  • import java.io.FileOutputStream;
  • import java.io.IOException;
  • import java.io.InputStreamReader;
  • import java.io.OutputStream;
  • import java.io.OutputStreamWriter;
  • import java.net.InetAddress;
  • import java.net.URL;
  • import java.net.UnknownHostException;
  • import java.util.Date;

  • public class GetIP {

  • ? ? ? ? /**
  • ? ? ? ???* @param args
  • ? ? ? ???*/
  • ? ? ? ? public static void main(String[] args){
  • ? ? ? ? ? ? ? ? // 通過純真網(wǎng)絡(luò)來獲取IP,因?yàn)閕p138網(wǎng)站有時(shí)不準(zhǔn)。
  • ? ? ? ? ? ? ? ? // 運(yùn)行程序時(shí)命令行輸入:http://www.cz88.net/ip/viewip778.aspx

  • ? ? ? ? ? ? ? ? boolean bHasNoArgs =false;
  • ? ? ? ? ? ? ? ? if(args.length<=0) bHasNoArgs =true;

  • ? ? ? ? ? ? ? ? StringBuffer sbFileContent =new StringBuffer();
  • ? ? ? ? ? ? ? ? boolean bGetSuccess =true;
  • ? ? ? ? ? ? ? ?
  • ? ? ? ? ? ? ? ? try {
  • ? ? ? ? ? ? ? ? ? ? ? ? InetAddress host =InetAddress.getLocalHost();
  • ? ? ? ? ? ? ? ? ? ? ? ?
  • ? ? ? ? ? ? ? ? ? ? ? ? String hostName =host.getHostName();
  • ? ? ? ? ? ? ? ? ? ? ? ? String hostAddr=host.getHostAddress();
  • ? ? ? ? ? ? ? ? ? ? ? ? String tCanonicalHostName =host.getCanonicalHostName();

  • ? ? ? ? ? ? ? ? ? ? ? ? Date da =new Date();
  • ? ? ? ? ? ? ? ? ? ? ? ? String osname =System.getProperty("os.name");
  • ? ? ? ? ? ? ? ? ? ? ? ? String osversion =System.getProperty("os.version");
  • ? ? ? ? ? ? ? ? ? ? ? ? String username =System.getProperty("user.name");
  • ? ? ? ? ? ? ? ? ? ? ? ? String userhome =System.getProperty("user.home");
  • ? ? ? ? ? ? ? ? ? ? ? ? String userdir =System.getProperty("user.dir");
  • ? ? ? ? ? ? ? ? ? ? ? ?
  • ? ? ? ? ? ? ? ? ? ? ? ? if(bHasNoArgs){
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? System.out.println("hostName is:"+hostName);
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? System.out.println("hostAddr is:"+hostAddr);

  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? System.out.println("Current Date is:"+da.toString());
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? System.out.println("osname is:"+osname);
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? System.out.println("osversion is:"+osversion);
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? System.out.println("username is:"+username);
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? System.out.println("userhome is:"+userhome);
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? System.out.println("userdir is:"+userdir);
  • ? ? ? ? ? ? ? ? ? ? ? ? }
  • ? ? ? ? ? ? ? ? ? ? ? ? else{
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? sbFileContent.append("hostName is:"+hostName+"\n");
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? sbFileContent.append("hostAddr is:"+hostAddr+"\n");
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? sbFileContent.append("Current Date is:"+da.toString()+"\n");
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? sbFileContent.append("osname is:"+osname+"\n");
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? sbFileContent.append("osversion is:"+osversion+"\n");
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? sbFileContent.append("username is:"+username+"\n");
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? sbFileContent.append("userhome is:"+userhome+"\n");
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? sbFileContent.append("userdir is:"+userdir+"\n");
  • ? ? ? ? ? ? ? ? ? ? ? ? }
  • ? ? ? ? ? ? ? ? ? ? ? ?
  • ? ? ? ? ? ? ? ? ? ? ? ? StringBuffer url =new StringBuffer();
  • ? ? ? ? ? ? ? ? ? ? ? ? if(bHasNoArgs||args[0].equals(null)||args[0].equals("")){
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? url.append("http://www.cz88.net/ip/viewip778.aspx");
  • ? ? ? ? ? ? ? ? ? ? ? ? }
  • ? ? ? ? ? ? ? ? ? ? ? ? else
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? url.append(args[0]);
  • ? ? ? ? ? ? ? ? ? ? ? ? StringBuffer strForeignIP =new StringBuffer("strForeignIPUnkown");
  • ? ? ? ? ? ? ? ? ? ? ? ? StringBuffer strLocation =new StringBuffer("strLocationUnkown");
  • ? ? ? ? ? ? ? ? ? ? ? ?
  • ? ? ? ? ? ? ? ? ? ? ? ?
  • ? ? ? ? ? ? ? ? ? ? ? ? if(GetIP.getWebIp(url.toString(),strForeignIP,strLocation)){
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if(bHasNoArgs){
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? System.out.println("Foreign IP is:"+strForeignIP);
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? System.out.println("Location is:"+strLocation);
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? else{
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? sbFileContent.append("Foreign IP is:"+strForeignIP+"\n");
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? sbFileContent.append("Location is:"+strLocation+"\n");
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
  • ? ? ? ? ? ? ? ? ? ? ? ? }
  • ? ? ? ? ? ? ? ? ? ? ? ? else{
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if(bHasNoArgs){
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? System.out.println("Failed to connect:"+url);
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? else{
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? bGetSuccess =false;
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? sbFileContent.append("Failed to connect:"+url+"\n");
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
  • ? ? ? ? ? ? ? ? ? ? ? ? }
  • ? ? ? ? ? ? ? ? ? ? ? ?
  • ? ? ? ? ? ? ? ? ? ? ? ?
  • ? ? ? ? ? ? ? ? } catch (UnknownHostException e) {
  • ? ? ? ? ? ? ? ? ? ? ? ? if(bHasNoArgs){
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? e.printStackTrace();
  • ? ? ? ? ? ? ? ? ? ? ? ? }
  • ? ? ? ? ? ? ? ? ? ? ? ? else{
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? bGetSuccess =false;
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? sbFileContent.append(e.getStackTrace()+"\n");
  • ? ? ? ? ? ? ? ? ? ? ? ? }
  • ? ? ? ? ? ? ? ? }
  • ? ? ? ? ? ? ? ?
  • ? ? ? ? ? ? ? ?
  • ? ? ? ? ? ? ? ? if(bGetSuccess)
  • ? ? ? ? ? ? ? ? ? ? ? ? sbFileContent.insert(0,"sucess"+"\n");
  • ? ? ? ? ? ? ? ? else
  • ? ? ? ? ? ? ? ? ? ? ? ? sbFileContent.insert(0,"fail"+"\n");
  • ? ? ? ? ? ? ? ? ? ? ? ?
  • ? ? ? ? ? ? ? ? if(!bHasNoArgs) write2file(sbFileContent);
  • ? ? ? ? ? ? ? ?
  • ? ? ? ? }

  • ? ? ? ?
  • ? ? ? ???public static boolean getWebIp(String strUrl,
  • ? ? ? ? ? ? ? ? ? ? ? ???StringBuffer strForeignIP,StringBuffer strLocation) {
  • ? ? ? ? ? ? ? ?? ?try {

  • ? ? ? ? ? ? ? ?? ? URL url = new URL(strUrl);

  • ? ? ? ? ? ? ? ?? ? BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));

  • ? ? ? ? ? ? ? ?? ? String s = "";
  • ? ? ? ? ? ? ? ?? ? StringBuffer sb = new StringBuffer("");
  • ? ? ? ? ? ? ? ?? ? while ((s = br.readLine()) != null) {
  • ? ? ? ? ? ? ? ?? ???sb.append(s + "\r\n");
  • ? ? ? ? ? ? ? ?? ? }
  • ? ? ? ? ? ? ? ?? ? br.close();
  • ? ? ? ? ? ? ? ?? ?
  • ? ? ? ? ? ? ? ?? ? String webContent = "";
  • ? ? ? ? ? ? ? ?? ? webContent = sb.toString();
  • ? ? ? ? ? ? ? ?? ?
  • ? ? ? ? ? ? ? ?? ? if( webContent.equals(null)|| webContent.equals("") ) return false;
  • ? ? ? ? ? ? ? ?? ?
  • ? ? ? ? ? ? ? ?? ?
  • ? ? ? ? ? ? ? ?? ?
  • ? ? ? ? ? ? ? ?? ? String flagofForeignIPString ="IPMessage";
  • ? ? ? ? ? ? ? ?? ? int startIP = webContent.indexOf(flagofForeignIPString)+flagofForeignIPString.length()+2;
  • ? ? ? ? ? ? ? ?? ? int endIP = webContent.indexOf("</span>",startIP);
  • ? ? ? ? ? ? ? ?? ? strForeignIP.delete(0, webContent.length());
  • ? ? ? ? ? ? ? ?? ? strForeignIP.append(webContent.substring(startIP,endIP));

  • ? ? ? ? ? ? ? ?? ? String flagofLocationString ="AddrMessage";
  • ? ? ? ? ? ? ? ?? ? int startLoc = webContent.indexOf(flagofLocationString)+flagofLocationString.length()+2;
  • ? ? ? ? ? ? ? ?? ? int endLoc = webContent.indexOf("</span>",startLoc);
  • ? ? ? ? ? ? ? ?? ? strLocation.delete(0, webContent.length());
  • ? ? ? ? ? ? ? ?? ? strLocation.append(webContent.substring(startLoc,endLoc));? ? ? ? ? ? ? ?? ?
  • ? ? ? ? ? ? ? ?? ?
  • ? ? ? ? ? ? ? ?? ? return true;

  • ? ? ? ? ? ? ? ?? ?} catch (Exception e) {
  • ? ? ? ? ? ? ? ?? ? //e.printStackTrace();
  • ? ? ? ? ? ? ? ?? ? return false;
  • ? ? ? ? ? ? ? ?? ?}
  • ? ? ? ? ? ? ? ???}? ? ? ?
  • ? ? ? ???

  • ? ? ? ???public static void??write2file(StringBuffer content){

  • ? ? ? ? ? ? ? ???if(content.length()<=0) return;
  • ? ? ? ? ? ? ? ???
  • ? ? ? ? ? ? ? ? ? ? ? ? try {
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? FileOutputStream fos = new FileOutputStream("GETIP.sys");
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? OutputStreamWriter osr =new OutputStreamWriter(fos);
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? BufferedWriter bw =new BufferedWriter(osr);? ? ? ?
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? try {
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? int index =0;
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? while(index>=0){
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? int preIndex =index;
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? index =content.indexOf("\n", preIndex+2);
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if(index>0){
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? String str =new String(content.substring(preIndex, index));
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? bw.write(str);
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? bw.newLine();
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? else{
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? String str =new String(content.substring(preIndex, content.length()-1));
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? bw.write(str);
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? break;
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? } catch (IOException e1) {
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? // TODO Auto-generated catch block
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //e1.printStackTrace();
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? try {
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? bw.close();
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? } catch (IOException e) {
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? // TODO Auto-generated catch block
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //e.printStackTrace();
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }
  • ? ? ? ? ? ? ? ? ? ? ? ? } catch (FileNotFoundException e) {
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? // TODO Auto-generated catch block
  • ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //e.printStackTrace();
  • ? ? ? ? ? ? ? ? ? ? ? ? }
  • ? ? ? ???}
  • }

  • 轉(zhuǎn)載于:https://www.cnblogs.com/Free-Thinker/p/3267907.html

    總結(jié)

    以上是生活随笔為你收集整理的Android 获取本地外网IP、内网IP、计算机名等信息的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。

    主站蜘蛛池模板: 免费激情av | 欧美日韩一区二区久久 | 国产精品九九九九 | 91色在线播放 | 99精品国产一区二区 | 日本三级少妇 | 欧美第一页在线观看 | 天天躁日日躁aaaa视频 | 欧美动态视频 | 亚洲激情婷婷 | 激情五月婷婷丁香 | 国产在线精品一区 | 午夜伦视频 | 最新日本中文字幕 | 日韩女女同性aa女同 | 丁香花电影高清在线阅读免费 | 91香蕉视频官网 | 成人91| 天堂网免费视频 | 亚洲AV无码久久精品国产一区 | 欧美a网站| 成年女人色毛片 | 国产激情视频网站 | 91爱视频| 国产欧美中文字幕 | 久久久www成人免费精品 | 桃色视屏 | 扒开伸进免费视频 | 哺乳期给上司喂奶hd | 99久久久无码国产精品免费麻豆 | 欧美黑人又粗又大的性格特点 | 国产欧美又粗又猛又爽 | 欧美成人精品欧美一 | 天堂在线中文网 | 国产免费高清视频 | 色呦呦网| 美女性高潮视频 | 天海翼视频在线观看 | 制服丝袜天堂网 | 人妖和人妖互交性xxxx视频 | 亚洲黄色免费网站 | 中日韩在线观看 | 国产一在线观看 | 中国二级毛片 | 国产激情无码一区二区 | 老头老夫妇自拍性tv | 老汉色av| 久久精品视频偷拍 | 国产又白又嫩又爽又黄 | 成人精品视频网站 | 精品免费国产一区二区三区 | 中文在线字幕免费观看电 | 91麻豆精品91久久久久同性 | 星空大象在线观看免费播放 | 国产美女福利视频 | caopeng视频| 日本少妇xxxxx| 亚洲区在线播放 | 二级毛片在线观看 | 女性裸体瑜伽无遮挡 | 精品久久久中文字幕人妻 | 无码aⅴ精品一区二区三区 精品久久在线 | 精品久久免费 | 草莓视频18免费观看 | 午夜视频污 | 久久九九久精品国产免费直播 | 91精品国产色综合久久不卡电影 | 日韩精品一二三四区 | 婷婷色影院 | 丰满双乳秘书被老板狂揉捏 | 欧美一级在线视频 | 亚洲精品久久久久av无码 | 亚洲操操操| 恶虐女帝安卓汉化版最新版本 | 久久久久久98 | 天天宗合 | 亚洲精选在线观看 | 91精品国自产在线偷拍蜜桃 | 性色一区 | 亚洲综合专区 | 少妇一级淫片免费放播放 | 又大又粗欧美黑人aaaaa片 | 波多野结衣av在线免费观看 | 日本高清视频www夜色资源 | 国产欧美精品一区二区在线播放 | 草草在线观看视频 | 四虎黄色影院 | 三级在线视频 | www.污视频 | 美女尻逼视频 | julia一区二区| 中文字幕专区 | 91成人福利在线 | 人妻 丝袜美腿 中文字幕 | 伊人色网站 | 邻居校草天天肉我h1v1 | 我和单位漂亮少妇激情 | 精品免费av | 亚洲 欧美 日韩在线 |