以下是引用恒隆君在2018/4/6 16:31:00的发言:
Exception has been thrown by the target of an invocation.
从字符串“2017-05-06'”到类型“Date”的转换无效。
afterOpenProject事件,短日期
Dim cd As System.Globalization.DateTimeFormatInfo = System.Globalization.DateTimeFormatInfo.CurrentInfo
cd.ShortDatePattern = "yyyy年MM月dd日"
Dim DateInfo As System.Reflection.FieldInfo = cd.Gettype.GetField("generalLongTimePattern", System.Reflection.BindingFlags.NonPublic Or System.Reflection.BindingFlags.Instance)
If DateInfo IsNot Nothing Then
DateInfo.SetValue(cd, "yyyy-MM-dd HH:mm:ss")
End If