获取客户端的MAC地址
来源:互联网 发布:prtg交换机端口传感器 编辑:程序博客网 时间:2024/05/18 02:24
using System.Text.RegularExpressions;
using System.Diagnostics;
using System.Diagnostics;
/// 获取客户端本地MAC
/// CODE CREATE BY BANLAO
/// </summary>
/// <param name="strIP">客户端的IP</param>
/// <returns></returns>
/// </summary>
/// <param name="strIP">客户端的IP</param>
/// <returns></returns>
public string _GetCustomerMac(string strIP)
{
string strResults = "";
ProcessStartInfo psi = new ProcessStartInfo();
Process proc = new Process();
psi.FileName = "nbtstat";
psi.RedirectStandardInput = false;
psi.RedirectStandardOutput = true;
psi.Arguments = "-a " + strIP;
psi.UseShellExecute = false;
proc = Process.Start(psi);
strResults = proc.StandardOutput.ReadToEnd();
proc.WaitForExit();
{
string strResults = "";
ProcessStartInfo psi = new ProcessStartInfo();
Process proc = new Process();
psi.FileName = "nbtstat";
psi.RedirectStandardInput = false;
psi.RedirectStandardOutput = true;
psi.Arguments = "-a " + strIP;
psi.UseShellExecute = false;
proc = Process.Start(psi);
strResults = proc.StandardOutput.ReadToEnd();
proc.WaitForExit();
//匹配mac地址
Match m = Regex.Match(strResults, "//w+//-//w+//-//w+//-//w+//-//w+//-//w//w");
//若匹配成功则返回mac,否则返回找不到主机信息
if (m.ToString() != "")
{
return m.ToString();
}
else
{
return "";
}
}
- 获取客户端的MAC地址
- 获取客户端MAC地址
- 获取客户端mac地址
- 获取客户端MAC地址
- 客户端获取MAC地址
- 获取客户端Mac地址
- 获取客户端mac地址
- 获取客户端Mac地址
- 用javascript获取客户端的MAC地址
- jsp如何获取客户端的mac地址
- 获取客户端网卡的MAC地址
- asp.net获取客户端的MAC地址
- 获取客户端的IP与MAC地址
- jsp如何获取客户端的mac地址
- 关于客户端获取MAC地址的探究
- 获取客户端网卡mac地址的方法
- JAVA获取客户端的MAC地址
- php获取服务器端mac和客户端mac的地址
- volatile关键字
- RoR开发-使用文档
- LINUX密码丢失解决
- ARP攻击及防御原理
- 守护进程介绍
- 获取客户端的MAC地址
- vc++实现文件加密解密
- 添加tomcat包
- 对市场的反应速度
- 15套优雅的配色方案代码
- 关于来信
- 这年头的男人女人
- asp.net跳转页面的三种方法比较
- 低调