Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                OpenFileDialog choofdlog = new OpenFileDialog();
                choofdlog.Filter      = "CSV files (*.csv)|*.csv";
                choofdlog.FilterIndex = 1;
                choofdlog.Multiselect = true;

                if (choofdlog.ShowDialog() == DialogResult.OK)
                {
                    fileName = choofdlog.FileName;
                }
                else
                {
                    fileName = string.Empty;
                }

                textBox1.Text = fileName;
                if (checkDone == 1)
                {
                    result.Dispose();
                    result           = new DataResult();
                    lbDuplicate.Text = "[xxx]";
                    lbError.Text     = "[xxx]";
                    lbSuccess.Text   = "[xxx]";
                    checkDone        = 0;
                }


                if (string.IsNullOrEmpty(textBox1.Text))
                {
                    MessageBox.Show("Include path file");
                }
                else
                {
                    worker.DoWork += Worker_DoWork;
                    worker.RunWorkerAsync();
                }
            }
            catch { }
        }