傲雪凌峰
一个后来者,期待在技术上有所进步。
public static string GetMac(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);
   }
   return mac;
  }
posted on 2007-06-27 15:19  傲雪凌峰  阅读(176)  评论(0)    收藏  举报