public string GetCustomerMac(string clientIP)
        {
            string Mac = "";
            System.Diagnostics.Process process = new System.Diagnostics.Process();
            process.StartInfo.FileName = "nbtstat";
            process.StartInfo.Arguments = "-a " + clientIP;
            process.StartInfo.UseShellExecute = false;
            process.StartInfo.CreateNoWindow = true;
            process.StartInfo.RedirectStandardOutput = true;
            process.Start();
            string output = process.StandardOutput.ReadToEnd();
            int length = output.IndexOf("MAC Address = ");
            if (length > 0)
            {
                Mac = output.Substring(length + 14, 17);
            }
            process.WaitForExit();
            return Mac;
        }
 posted on 2006-11-04 00:45  心有灵犀  阅读(186)  评论(0编辑  收藏  举报