using System; using System.Runtime.InteropServices; using System.Management; namespace Hardware { /// <summary> /// Hardware_Mac 的摘要说明。 /// </summary> public class HardwareInfo { //取机器名 public string GetHostName() { return System.Net.Dns.GetHostName(); } //取CPU编号 public String GetCpuID() Read More
如果要想获得远程的地址,需要用sendarp这个函数来实现。具体的代码如下:[DllImport("Iphlpapi.dll")]private static unsafe extern int SendARP(Int32 dest,Int32 host,ref IntPtr mac,ref IntPtr length);[DllImport("Ws2_32.dll")]private static extern Int32 inet_addr(string ip);Int32 ldest= inet_addr("157.60.68.163&q Read More