Exemplo n.º 1
0
        private void Registration_Load(object sender, EventArgs e)
        {
            string hostName = Dns.GetHostName(); // Retrive the Name of HOST
            string myIP     = Dns.GetHostByName(hostName).AddressList[0].ToString();

            lblip.Text  = myIP;
            label8.Text = s.GetMacAddress();
        }
      private void Download_Load(object sender, EventArgs e)
      {
          string         query = "select * from [Share] where [Friendid]='" + label1.Text + "'";
          SqlDataAdapter sda   = new SqlDataAdapter(query, con);
          DataTable      dt    = new DataTable();

          sda.Fill(dt);
          if (dt.Rows.Count > 0)
          {
              dataGridView1.DataSource = dt;
          }
          string hostName = Dns.GetHostName();   // Retrive the Name of HOST
          string myIP     = Dns.GetHostByName(hostName).AddressList[0].ToString();

          lblip.Text  = myIP;
          label8.Text = s.GetMacAddress();
      }