From c0f9915265878e56e91ee97f7f8d925db1e12626 Mon Sep 17 00:00:00 2001 From: cloudflight <cloudflight@126.com> Date: 星期六, 02 十二月 2023 18:50:45 +0800 Subject: [PATCH] 2023年12月2日_3 --- Hydro.CommonBase/Helper/ExcelHelper.cs | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Hydro.CommonBase/Helper/ExcelHelper.cs b/Hydro.CommonBase/Helper/ExcelHelper.cs index 906db58..8271b00 100644 --- a/Hydro.CommonBase/Helper/ExcelHelper.cs +++ b/Hydro.CommonBase/Helper/ExcelHelper.cs @@ -241,12 +241,12 @@ } else { - throw new Exception("娌℃湁鏁版嵁鍙緵瀵煎嚭"); + MessageBox.Show("娌℃湁鏁版嵁鍙緵瀵煎嚭", "鎻愮ず"); } } catch { - throw new Exception("鎿嶄綔澶辫触"); + MessageBox.Show("鎿嶄綔澶辫触", "鎻愮ず"); } }//DataSet杈撳嚭Excel @@ -281,8 +281,8 @@ if (filePath.Length <= 0 || !(extension == ".xls" || extension == ".xlsx" || extension == ".csv")) { - throw new Exception("鏂囦欢鍚嶇О閿欒鎴栬�呮牸寮忛敊璇�"); - //return null; + MessageBox.Show("鏂囦欢鍚嶇О閿欒鎴栬�呮牸寮忛敊璇�"); + return null; } int r = 0; @@ -633,8 +633,8 @@ if (strFileNme.Length <= 0 || !(strFileNme.Substring(strFileNme.LastIndexOf(".")).ToLower() == ".xls" || strFileNme.Substring(strFileNme.LastIndexOf(".")).ToLower() == ".xlsx")) { - throw new Exception("鏂囦欢鍚嶇О閿欒鎴栬�呮牸寮忛敊璇�"); - //return null; + MessageBox.Show("鏂囦欢鍚嶇О閿欒鎴栬�呮牸寮忛敊璇�"); + return null; } int r = 0; -- Gitblit v1.9.3