統計WIFI熱點客戶機鏈接數

    public static int getTetherClientCount() {
        BufferedReader br = null;
        int count = 0;
               try {
            br = new BufferedReader(new FileReader("/proc/net/arp"));
            String line;
            while ((line = br.readLine()) != null) {
               if (line.indexOf("192.168.43") != -1){
                count++;
               }
            }get

        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                br.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return count;
    }io

相關文章
相關標籤/搜索