请说的具体一些。

解决方案 »

  1.   

    http://community.csdn.net/Expert/topic/3727/3727617.xml?temp=4.088992E-02
    http://community.csdn.net/Expert/topic/3738/3738340.xml?temp=.4684107
      

  2.   

    public class Win32 {
           [DllImport("Iphlpapi.dll")]
           public static  extern int SendARP(Int32 dest,Int32 host,ref IntPtr mac,ref IntPtr length);
           [DllImport("Ws2_32.dll")]
           public static extern Int32 inet_addr(string ip);
        }//调用dll的类     void mac()
          {
            Int32 ldest= Win32.inet_addr(Request.UserHostAddress);//目的地的ip
           Int32 lhost=Win32.inet_addr("190.10.51.5");//本地的ip
           try
            {
             Byte[] macinfo=new Byte[6];
             Int32 length=6;
        
             IntPtr mac=new IntPtr(macinfo[0]);
             IntPtr len=new IntPtr(6);
             int ii=Win32.SendARP(ldest,lhost, ref mac, ref len);
     
             
             ip+="**mac地址:"+mac.ToString();
                }
             catch(Exception err)
              {
             ip+="";
              }
             }//mac