Created
June 21, 2023 23:09
-
-
Save Hedgehogs1974/5bb49195099277544fb09a13d535750b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dim Year As String = Text.ToString.Substring(0, 2) | |
Dim Month As String = Text.ToString.Substring(2, 2) | |
Dim Day As String = Text.ToString.Substring(4, 2) | |
Try | |
'日付型に変換して有効な値が設定されているか確認する | |
Dim tmp As String = String.Format("20{0}/{1}/{2}", Year, Month, Day) | |
DateTime.Parse(tmp) | |
Catch | |
MessageBox.Show("有効な日付を設定してください") | |
Me.Focus() | |
Return | |
End Try |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment