zoukankan      html  css  js  c++  java
  • 取客户端MAC地址的方法

     1public static string GetMac(string clientip)
     2        {
     3            string mac="";
     4            System.Diagnostics.Process process=new System.Diagnostics.Process();
     5            process.StartInfo.FileName="nbtstat";
     6            process.StartInfo.Arguments="-a "+clientip;
     7            process.StartInfo.UseShellExecute=false;
     8            process.StartInfo.CreateNoWindow=true;
     9            process.StartInfo.RedirectStandardOutput=true;
    10            process.Start();
    11            string output=process.StandardOutput.ReadToEnd();
    12            int length=output.IndexOf("MAC Address =");
    13            if(length>0)
    14            {
    15                mac=output.Substring(length+14,17);
    16            }

    17            return mac;
    18        }

    19
    20    }
  • 相关阅读:
    FileWatcher
    virtual table(有180个评论)
    this 指针
    docker -ce(社区免费版)
    vue-cli
    CAP理论、BASE理论
    B+树和LSM存储引擎代表树和B-树
    CPU高速缓存
    Python&基础环境搭建
    二叉树
  • 原文地址:https://www.cnblogs.com/DarkAngel/p/382177.html
Copyright © 2011-2022 走看看