这是我的代码 -
Dim provider As CultureInfo = CultureInfo.InvariantCulture
Dim a1 As DateTime = Nothing
insexp = DateTime.ParseExact(date1.SelectedValue, "MMMM yyyy", provider)
If a1.Month = Today.Month AndAlso a1.Year = Today.Year Then
a1 = Today.Date
End If
Run Code Online (Sandbox Code Playgroud)
这仅在date1.selectedvalue不为null时才有效,但如果为null则会崩溃.如果条件不运行,我该怎么办?谢谢
| 归档时间: |
|
| 查看次数: |
974 次 |
| 最近记录: |