Ejemplo n.º 1
0
 public Collegamento(Form1 F, int numm)
 {
     InitializeComponent();
     receivingUdpClient = F.receivingUdpClient;
     i      = 0;
     this.F = F;
     if (numm == 1)
     {
         M = new CModulo(1);
         M = F.M1;
     }
     else if (numm == 2)
     {
         M = new CModulo(2);
         M = F.M2;
     }
     MessageBox.Show(M.getIP());
     listView1.View = View.Details;
     // Allow the user to edit item text.
     listView1.LabelEdit = true;
     // Allow the user to rearrange columns.
     listView1.AllowColumnReorder = true;
     // Select the item and subitems when selection is made.
     listView1.FullRowSelect = true;
     // Display grid lines.
     listView1.GridLines = true;
     listView1.Columns.Add("Nome rete d'area", -2, HorizontalAlignment.Left);
     porte = SerialPort.GetPortNames();
     comboBox1.Items.AddRange(porte);
 }
Ejemplo n.º 2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            M1 = new CModulo(1);
            M2 = new CModulo(2);
            string letto = "";

            letto = File.ReadAllText(Directory.GetCurrentDirectory() + @"\..\..\Resources\IPMODULI.txt");
            if (letto == "0")
            {
                button3.Enabled = false;
            }
            else
            {
                string[] righe = letto.Split('\n');
                string[] riga1 = righe[1].Split(';');
                string[] riga2 = righe[2].Split(';');
                M1.setIP(riga1[1]);
                if (riga2[0] == "1")
                {
                    M2.setIP(riga2[1]);
                }
                //MessageBox.Show(M1.getIP());
            }
        }