csharp develop's room

 

同一局域网中获取客户端IP及MAC地址

 1using System;
 2using System.Collections.Generic;
 3using System.Text;
 4using System.Web;
 5using System.Web.UI;
 6using System.Web.UI.WebControls;
 7using System.Runtime.InteropServices;
 8
 9namespace SkyMac
10{
11    public class GetMac
12    {
13        [DllImport("Iphlpapi.dll")]
14        private static extern int SendARP(Int32 dest, Int32 host, ref Int64 mac, ref Int32 length);
15        [DllImport("Ws2_32.dll")]
16        private static extern Int32 inet_addr(string ip);
17
18        获取客户IP地址
34
35        获取客户MAC地址
86
87    }

88}

89

posted on 2007-08-10 14:49  weboy  阅读(449)  评论(0)    收藏  举报

导航