usingSystem.Net;usingSystem;usingSystem.Management;usingSystem.Runtime.InteropServices;usingSystem.Collections.Generic;usingSystem.Text;usingSystem.Text.RegularExpressions;public classArpHelper
{
[DllImport("Iphlpapi.dll")]private static extern int SendARP(Int32 dest, Int32 host, ref Int64 mac, refInt32 length);
[DllImport("Ws2_32.dll")]private static extern Int32 inet_addr(stringip);//使用arp -a命令获取ip和mac地址
public ListGetAllMacAddressesAndIppairs()
{
List mip = new List();
System.Diagnostics.Process pProcess= newSystem.Diagnostics.Process();
pProcess.StartInfo.FileName= "arp";
pProcess.StartInfo.Arguments= "-a";
pProcess.StartInfo.UseShellExecute= false;
pProcess.StartInfo.RedirectStandardOutput= true;
pProcess.StartInfo.CreateNoWindow= true;
pProcess.Start();str