Exemple #1
0
        private void загрузитьToolStripMenuItem_Click(object sender, EventArgs e)
        {
            openFileDialog1 = new OpenFileDialog();
            openFileDialog1.InitialDirectory = @"c:\MyFolder\Default\";
            openFileDialog1.Filter           = "Text Files (*.txt)|*.txt|"
                                               + "Comma-Delimited Files (*.csv)|*.csv|All Files (*.*)|*.*";
            openFileDialog1.CheckFileExists = true;
            openFileDialog1.CheckPathExists = false;
            DialogResult result = openFileDialog1.ShowDialog();

            if (result == DialogResult.OK)
            {
                lstPorts.Items.Clear();
                portram.LoadSomeFile(openFileDialog1.FileName);
                foreach (PortStatus.PortStatus port in portram.GetPortList())
                {
                    PortToWinList(port);
                }
            }
        }