Example #1
0
        private void BTN_Open_Click(object sender, EventArgs e)
        {
            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                dataGridView1.Rows.Clear();
                Txt_filepath.Text = Path.GetFileNameWithoutExtension(openFileDialog.FileName);;

                string[]      datalog = new string[7];
                List <string> value   = new List <string>();

                if (csv.load(openFileDialog.FileName).Count > 0)
                {
                    try
                    {
                        value = csv.load(openFileDialog.FileName);
                        dataGridView1.RowCount = value.Count;

                        for (int i = 0; i < value.Count - 1; i++)
                        {
                            datalog = value[i + 1].Split(',');
                            for (int j = 0; j < dataGridView1.ColumnCount; j++)
                            {
                                dataGridView1.Rows[i].Cells[j].Value = datalog[j];
                            }
                        }
                    }
                    catch
                    {
                        MessageBox.Show("잘못된 파일입니다. 로그파일을 불러오세요.", "OK", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }
Example #2
0
        private void BTN_Open_Click(object sender, EventArgs e)
        {
            string[]      datalog = new string[5];
            List <string> list    = new List <string>();
            List <string> value   = new List <string>();

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                string filename = openFileDialog.FileName;
                if (csv.load(filename).Count > 0)
                {
                    value = csv.load(filename);

                    chart1.Series[0].BorderWidth = 2;
                    chart1.Series[0].Color       = Color.Red;

                    dataGridView1.Rows.Clear();
                    dataGridView1.RowCount = value.Count - 2;
                    RowCount = dataGridView1.RowCount;
                    for (int i = 0; i < value.Count - 2; i++)
                    {
                        datalog = value[i + 1].Split(',');
                        for (int j = 0; j < dataGridView1.ColumnCount; j++)
                        {
                            dataGridView1.Rows[i].Cells[j].Value = datalog[j];
                        }
                    }
                    dataGridView1.RowCount = value.Count - 1;
                    datalog           = value[value.Count - 1].Split(',');
                    Txt_LimC.Text     = datalog[4];
                    Txt_LimC.ReadOnly = false;
                }
            }
        }