Using System;
Using System. Drawing;
Using System. Management;
Using System. Net;
Using System. Net. Sockets;
Using System. Collections;
Using System. ComponentModel;
Using System. Windows. Forms;
Using System. Data;
Namespace MAC_IP_name
{
/// <Summary>
/// Summary of Form1.
/// </Summary>
Public class Form1: System. Windows. Forms. Form
{
Private System. Windows. Forms. Label label4;
Private System. Windows. Forms. GroupBox groupBox1;
Private System. Windows. Forms. TextBox txtMac;
Private System. Windows. Forms. TextBox txtIp;
Private System. Windows. Forms. TextBox txtName;
Private System. Windows. Forms. Label lblMac;
Private System. Windows. Forms. Label lblIp;
Private System. Windows. Forms. Label lblName;
Private System. Windows. Forms. Button button1;
Private System. Windows. Forms. Button button2;
/// <Summary>
/// Required designer variables.
/// </Summary>
Private System. ComponentModel. Container components = null;
Public Form1 ()
{
//
// Required for Windows Form Designer support
//
InitializeComponent ();
//
// TODO: add Any constructor code after InitializeComponent calls
//
}
/// <Summary>
/// Clear all resources in use.
/// </Summary>
Protected override void Dispose (bool disposing)
{
If (disposing)
{
If (components! = Null)
{
Components. Dispose ();
}
}
Base. Dispose (disposing );
}
# Region code generated by Windows Form Designer
/// <Summary>
/// The designer supports the required methods-do not use the code editor to modify
/// Content of this method.
/// </Summary>
Private void InitializeComponent ()
{
This. label4 = new System. Windows. Forms. Label ();
This. groupBox1 = new System. Windows. Forms. GroupBox ();
This. button2 = new System. Windows. Forms. Button ();
This.txt Mac = new System. Windows. Forms. TextBox ();
This.txt Ip = new System. Windows. Forms. TextBox ();
This.txt Name = new System. Windows. Forms. TextBox ();
This. lblMac = new System. Windows. Forms. Label ();
This. lblIp = new System. Windows. Forms. Label ();
This. lblName = new System. Windows. Forms. Label ();
This. button1 = new System. Windows. Forms. Button ();
This. groupBox1.SuspendLayout ();
This. SuspendLayout ();
//
// Label4
//
This. label4.AutoSize = true;
This. label4.Font = new System. drawing. font (" _ GB2312", 15F, System. drawing. fontStyle. bold, System. drawing. graphicsUnit. point, (System. byte) (134 )));
This. label4.ForeColor = System. drawing. color. fromArgb (System. byte) (255), (System. byte) (128), (System. byte) (128 )));
This. label4.Location = new System. Drawing. Point (49, 16 );
This. label4.Name = "label4 ";
This. label4.Size = new System. Drawing. Size (245, 26 );
This. label4.TabIndex = 7;
This. label4.Text = "get the IP address and MAC address of the Local Computer ";
//
// GroupBox1
//
This. groupBox1.Controls. Add (this. button2 );
This.groupBox1.Controls.Add(this.txt Mac );
This.groupBox1.Controls.Add(this.txt Ip );
This.groupBox1.Controls.Add(this.txt Name );
& Nb