Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
LoCaL IP - Form1.cs

Form1.cs

Caricato da:
Scarica il programma completo

  1. using System;
  2. using System.Drawing;
  3. using System.Collections;
  4. using System.ComponentModel;
  5. using System.Windows.Forms;
  6. using System.Data;
  7. using System.Net;
  8. using System.Net.Sockets;
  9. using System.Threading;
  10.  
  11. namespace WindowsApplication25
  12. {
  13.         /// <summary>
  14.         /// Descrizione di riepilogo per Form1.
  15.         /// </summary>
  16.         public class Form1 : System.Windows.Forms.Form
  17.         {
  18.                 private System.Windows.Forms.Button button1;
  19.                 private System.Windows.Forms.TextBox t1;
  20.                 /// <summary>
  21.                 /// Variabile di progettazione necessaria.
  22.                 /// </summary>
  23.                 private System.ComponentModel.Container components = null;
  24.  
  25.                 public Form1()
  26.                 {
  27.                         //
  28.                         // Necessario per il supporto di Progettazione Windows Form
  29.                         //
  30.                         InitializeComponent();
  31.  
  32.                         //
  33.                         // TODO: aggiungere il codice del costruttore dopo la chiamata a InitializeComponent
  34.                         //
  35.                 }
  36.  
  37.                 /// <summary>
  38.                 /// Pulire le risorse in uso.
  39.                 /// </summary>
  40.                 protected override void Dispose( bool disposing )
  41.                 {
  42.                         if( disposing )
  43.                         {
  44.                                 if (components != null)
  45.                                 {
  46.                                         components.Dispose();
  47.                                 }
  48.                         }
  49.                         base.Dispose( disposing );
  50.                 }
  51.                 /* LoCaL Ip SCriTTo Da SaTaNa x La CoMMuNiTy WwW.PieRoToFy.It */
  52.                 public void lip()
  53.                 {
  54.                         string sHostName = Dns.GetHostName();
  55.                         IPHostEntry ipE = Dns.GetHostByName (sHostName);
  56.                         IPAddress [] IpA = ipE.AddressList;
  57.                         string localip = IpA[0].ToString();
  58.                         MessageBox.Show(localip);
  59.                 }
  60.                 #region Codice generato da Progettazione Windows Form
  61.                 /// <summary>
  62.                 /// Metodo necessario per il supporto della finestra di progettazione. Non modificare
  63.                 /// il contenuto del metodo con l'editor di codice.
  64.                 /// </summary>
  65.                 private void InitializeComponent()
  66.                 {
  67.                         this.button1 = new System.Windows.Forms.Button();
  68.                         this.t1 = new System.Windows.Forms.TextBox();
  69.                         this.SuspendLayout();
  70.                         //
  71.                         // button1
  72.                         //
  73.                         this.button1.Location = new System.Drawing.Point(56, 64);
  74.                         this.button1.Name = "button1";
  75.                         this.button1.Size = new System.Drawing.Size(160, 64);
  76.                         this.button1.TabIndex = 0;
  77.                         this.button1.Text = "button1";
  78.                         this.button1.Click += new System.EventHandler(this.button1_Click);
  79.                         //
  80.                         // t1
  81.                         //
  82.                         this.t1.Location = new System.Drawing.Point(80, 176);
  83.                         this.t1.Name = "t1";
  84.                         this.t1.Size = new System.Drawing.Size(120, 20);
  85.                         this.t1.TabIndex = 1;
  86.                         this.t1.Text = "";
  87.                         //
  88.                         // Form1
  89.                         //
  90.                         this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
  91.                         this.ClientSize = new System.Drawing.Size(8, 8);
  92.                         this.Controls.Add(this.t1);
  93.                         this.Controls.Add(this.button1);
  94.                         this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
  95.                         this.Name = "Form1";
  96.                         this.Text = "Form1";
  97.                         this.Load += new System.EventHandler(this.Form1_Load);
  98.                         this.ResumeLayout(false);
  99.  
  100.                 }
  101.                 #endregion
  102.  
  103.                 /// <summary>
  104.                 /// Il punto di ingresso principale dell'applicazione.
  105.                 /// </summary>
  106.                 [STAThread]
  107.                 static void Main()
  108.                 {
  109.                         Application.Run(new Form1());
  110.                 }
  111.  
  112.                 private void button1_Click(object sender, System.EventArgs e)
  113.                 {
  114.                  
  115.                 }
  116.  
  117.                 private void Form1_Load(object sender, System.EventArgs e)
  118.                 {
  119.                         Thread t = new Thread(new ThreadStart(lip));
  120.                         t.Start();
  121.                 }
  122.         }
  123. }