如何获取客户端的物理地址

解决方案 »

  1.   

    up  知道用net命令查看 客户端的mac地址
      

  2.   

    转贴网上的,你自己看看吧
    [DllImport("Iphlpapi.dll")] 
    private static extern int SendARP(Int32 dest,Int32 host,ref Int64 mac,ref Int32 length); 
    [DllImport("Ws2_32.dll")] 
    private static extern Int32 inet_addr(string ip); static private Int64 getRemoteMAC(string localIP, string remoteIP) 

    Int32 ldest= inet_addr(remoteIP); //目的地的ip 
    Int32 lhost= inet_addr(localIP); //本地服务器的ip try 

    Int64 macinfo = new Int64(); 
    Int32 len = 6; 
    int res = SendARP(ldest,0, ref macinfo, ref len); 
    return macinfo; 

    catch(Exception err) 

    Console.WriteLine("Error:{0}",err.Message); 

    return 0;