From a725e8b58d445ca00071762f6484a3de4e1474ae Mon Sep 17 00:00:00 2001
From: cdk <2441919651@qq.com>
Date: 星期五, 07 十一月 2025 08:39:16 +0800
Subject: [PATCH] Merge branch 'master' of http://git.gs-mes.com:8080/r/~tjx/GsMesClient
---
DevApp/Gs.DevApp/XtraForm1.cs | 31 +++++++++++++++++++++++++++++++
1 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/DevApp/Gs.DevApp/XtraForm1.cs b/DevApp/Gs.DevApp/XtraForm1.cs
index 7ecc96b..77292b8 100644
--- a/DevApp/Gs.DevApp/XtraForm1.cs
+++ b/DevApp/Gs.DevApp/XtraForm1.cs
@@ -324,5 +324,36 @@
}
richTextBox1.Text = sbLine.ToString();
}
+
+ private void simpleButton3_Click(object sender, EventArgs e)
+ {
+ string ddd = "1";
+ try
+ {
+ if (IsValidDate(ddd, "鏃ユ湡"))
+ MessageBox.Show("姝e父");
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message);
+ }
+
+ }
+
+ /// <summary>
+ /// 鍒ゆ柇鏄惁涓烘棩鏈�
+ /// </summary>
+ /// <param name="dateString"></param>
+ /// <returns></returns>
+ public bool IsValidDate(string dateString, string ziDuan = "")
+ {
+ bool bl = DateTime.TryParse(dateString, out _);
+ if (bl == true)
+ return bl;
+ if (string.IsNullOrEmpty(ziDuan))
+ return bl;
+ throw new Exception(ziDuan + "涓嶆槸鍚堟硶鐨勬棩鏈熺被鍨嬶紒");
+ }
+
}
}
\ No newline at end of file
--
Gitblit v1.9.3