using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Management; namespace FortuneWeb ...{ publicpartialclass WebForm1 : System.Web.UI.Page ...{ protectedvoid Page_Load(object sender, EventArgs e) ...{ } protectedvoid Button1_Click(object sender, EventArgs e) ...{ ManagementClass mc =new ManagementClass("Win32_NetworkAdapterConfiguration"); ManagementObjectCollection moc = mc.GetInstances(); foreach (ManagementObject mo in moc) ...{ if ((bool)mo["IPEnabled"] ==true) Label1.Text = mo["MacAddress"].ToString(); } } } }