麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 開發(fā) > PHP > 正文

php獲取網(wǎng)卡地址

2024-05-04 20:10:52
字體:
供稿:網(wǎng)友

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php 
class Getmac{ 
    var $result array(); // 返回帶有MAC地址的字串?dāng)?shù)組 
    var $macAddr;
    /*構(gòu)造*/
    function __construct($osType){ 
        switch strtolower($osType) ){ 
            case "unix"break;
            case "solaris"break;
            case "aix"break;
            case "linux": {
                $this->for_linux_os();
            }break
            default: { 
                $this->for_windows_os(); 
            }break
        
        $temp_array array(); 
        foreach($this->result as $value){
            if(preg_match("/[0-9a-f][0-9a-f][:-]"."[0-9a-f][0-9a-f][:-]"."[0-9a-f][0-9a-f][:-]"."[0-9a-f][0-9a-f][:-]"."[0-9a-f][0-9a-f][:-]"."[0-9a-f][0-9a-f]/i",$value
                $temp_array ) ){ 
                $this->macAddr = $temp_array[0]; 
                break
            
        
        unset($temp_array); 
        return $this->macAddr; 
    }
    /*linux系統(tǒng)中獲取方法*/
    function for_linux_os(){ 
        @exec("ifconfig -a"$this->result); 
        return $this->result; 
    }
    /*win系統(tǒng)中的獲取方法*/
    function for_windows_os(){ 
        @exec("ipconfig /all"$this->result); 
        if $this->result ) {
            return $this->result;
        else 
            $ipconfig $_SERVER["WINDIR"]."/system32/ipconfig.exe";
            if(is_file($ipconfig)) {
                @exec($ipconfig." /all"$this->result);
            else {
                @exec($_SERVER["WINDIR"]."/system/ipconfig.exe /all"$this->result);
                return $this->result; 
            }
        
    
 
/*1.實(shí)現(xiàn)化類   2.直接訪問它的macAddr屬性*/
$getMac new Getmac(PHP_OS); 
echo $getMac->macAddr; 
?>

 

挺好用的!

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 日本中文字幕电影在线观看 | 亚洲欧洲av在线 | h视频在线观看免费 | 视频一区二区三区免费观看 | 91成人在线网站 | 视频一区二区三区在线播放 | 国内精品视频饥渴少妇在线播放 | 国产在线观看 | 一级毛片在线免费播放 | 久久国产亚洲精品 | 视频国产一区二区 | 免费国产wwwwwww网站 | 国产精品午夜未成人免费观看 | 欧美大电影免费观看 | 亚洲91精品 | 毛片a片 | xxxx18韩国护士hd老师 | 国产午夜精品一区二区三区四区 | 亚洲欧美国产视频 | 国产精品自在线拍 | 精品国产一区二区三区四 | 日韩av片在线播放 | 欧美一级成人 | 国产亚洲精品久久久久婷婷瑜伽 | 成人午夜精品 | 免费播放av| 国产精品久久久久影院老司 | 久久久久久久久久91 | 黄色网址在线播放 | 久久精品亚洲欧美日韩精品中文字幕 | 逼片| 中文字幕精品在线观看 | av在线试看 | caoporn国产一区二区 | 黄色av片在线观看 | 韩国一级免费视频 | 涩涩激情网 | 1区2区3区国产| 91免费视频版 | 毛片在哪看 | 国产人成免费爽爽爽视频 |