예제 #1
0
        private static void HandleExcelFileByUser(string fileName, DataTable dt)
        {
            Cursor.Current = Cursors.Default;
            var ret = MessageBox.Show($"Excel File '{fileName}' with {dt.Rows.Count} rows and {dt.Columns.Count} column created!\r\n\r\nYes: Open Excel File\r\nNo: Open Folder\r\nCancel: Do nothing",
                                      "Excel File created!", MessageBoxButtons.YesNoCancel);

            switch (ret)
            {
            case DialogResult.Yes:
                HoUtil.StartFile(fileName);
                break;

            case DialogResult.No:
                HoUtil.ShowFolder(Path.GetDirectoryName(fileName));
                break;
            }
        }