using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Net;
using System.Net.Sockets;
using System.Threading;
namespace WindowsApplication25
{
/// <summary>
/// Descrizione di riepilogo per Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox t1;
/// <summary>
/// Variabile di progettazione necessaria.
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Necessario per il supporto di Progettazione Windows Form
//
InitializeComponent();
//
// TODO: aggiungere il codice del costruttore dopo la chiamata a InitializeComponent
//
}
/// <summary>
/// Pulire le risorse in uso.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
/* LoCaL Ip SCriTTo Da SaTaNa x La CoMMuNiTy WwW.PieRoToFy.It */
public void lip()
{
string sHostName = Dns.GetHostName();
IPHostEntry ipE = Dns.GetHostByName (sHostName);
IPAddress [] IpA = ipE.AddressList;
string localip = IpA[0].ToString();
MessageBox.Show(localip);
}
#region Codice generato da Progettazione Windows Form
/// <summary>
/// Metodo necessario per il supporto della finestra di progettazione. Non modificare
/// il contenuto del metodo con l'editor di codice.
/// </summary>
private void InitializeComponent()
{
this.
button1 = new System.
Windows.
Forms.
Button();
this.
t1 = new System.
Windows.
Forms.
TextBox();
this.SuspendLayout();
//
// button1
//
this.
button1.
Location = new System.Drawing.
Point(56, 64
);
this.button1.Name = "button1";
this.
button1.
Size = new System.Drawing.
Size(160, 64
);
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.
button1.
Click += new System.
EventHandler(this.
button1_Click);
//
// t1
//
this.
t1.
Location = new System.Drawing.
Point(80, 176
);
this.t1.Name = "t1";
this.
t1.
Size = new System.Drawing.
Size(120, 20
);
this.t1.TabIndex = 1;
this.t1.Text = "";
//
// Form1
//
this.
AutoScaleBaseSize = new System.Drawing.
Size(5, 13
);
this.
ClientSize = new System.Drawing.
Size(8, 8
);
this.Controls.Add(this.t1);
this.Controls.Add(this.button1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "Form1";
this.Text = "Form1";
this.
Load += new System.
EventHandler(this.
Form1_Load);
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// Il punto di ingresso principale dell'applicazione.
/// </summary>
[STAThread]
static void Main()
{
Application.
Run(new Form1
());
}
private void button1_Click(object sender, System.EventArgs e)
{
}
private void Form1_Load(object sender, System.EventArgs e)
{
Thread t
= new Thread
(new ThreadStart
(lip
));
t.Start();
}
}
}