public IActionResult ExportFilterSetting() { try { // 調用 CSVService 提供的函數來匯出設定檔 CSVService.ExportFilterSetting(_context); return(RedirectToRoute(new { controller = "Setting", action = "Index" })); } catch (Exception ex) { _logger.LogError(ex.ToString()); ViewBag.Error = "匯出設定時發生錯誤,請查看LOG!"; return(View("~/Views/Shared/ErrorPage.cshtml")); } }