سلام استاد کد شما رو با فرمایشاتی که فرمودین تغییر دادم.ممنون میشم بررسی کنید
Public Function CheckDate(ByVal inputDate As String) As String
Dim splittedDate As List(Of String) = inputDate.Split(Convert.ToChar("/")).ToList()
If splittedDate(0).Length = 2 Then
splittedDate(0) = "13" + splittedDate(0)
End If
Try
If CInt(splittedDate(0)).ToString("D2").Length <> 4 Then
MsgBox("کاربر گرامی سال وارد شده صحیح نمی باشد", MsgBoxStyle.Information, "هشدار")
Exit Function
End If
If CInt(splittedDate(0)).ToString("D2") > 1399 Then
MsgBox("کاربر گرامی سال وارد شده صحیح نمی باشد", MsgBoxStyle.Information, "هشدار")
Exit Function
End If
If CInt(splittedDate(1)).ToString("D2") > 12 Then
MsgBox("کاربر گرامی ماه وارد شده صحیح نمی باشد", MsgBoxStyle.Information, "هشدار")
Exit Function
End If
If CInt(splittedDate(1)).ToString("D2") <= 5 And CInt(splittedDate(2)).ToString("D2") > 31 Then
MsgBox("کاربر گرامی روز وارد شده صحیح نمی باشد", MsgBoxStyle.Information, "هشدار")
Exit Function
End If
If CInt(splittedDate(1)).ToString("D2") >= 6 And CInt(splittedDate(2)).ToString("D2") > 30 Then
MsgBox("کاربر گرامی روز وارد شده صحیح نمی باشد", MsgBoxStyle.Information, "هشدار")
Exit Function
End If
Catch ex As Exception
MsgBox("کاربر گرامی اطلاعات وارد شده صحیح نمی باشد", MsgBoxStyle.Information, "هشدار")
Exit Function
End Try
Return splittedDate(0) + "/" + CInt(splittedDate(1)).ToString("D2") + "/" + CInt(splittedDate(2)).ToString("D2")
End Function