private void SetDirects()
        {
            string p;

            if (File.Exists("LastDirectory.txt") && Expendator.IfDirectoryExists("LastDirectory.txt", out p))
            {
                globalbase = p;
            }
            else
            {
                p = "Замеры";
                Directory.CreateDirectory(p);
                globalbase = Path.Combine(Environment.CurrentDirectory, p);
            }

            textBox12.Text = globalbase;
            SetForlders();
            SetFiles();

            listBox2.Items.Clear();
            for (int i = 0; i < countPorts; i++)
            {
                listBox2.Items.Add(i);
            }
            listBox2.SelectedIndex = countPorts / 2;
        }