fix(validate): 超过 Int 存储范围

This commit is contained in:
wyc-26
2025-11-02 08:22:22 +08:00
committed by GitHub
parent efd480f06c
commit 865f5a93e7
@@ -113,9 +113,9 @@ Public Class ValidateInteger
Me.Max = Max Me.Max = Max
End Sub End Sub
Public Overrides Function Validate(Str As String) As String Public Overrides Function Validate(Str As String) As String
If Str.Length > 9 Then Return "请输入一个大小合理的数字!"
Dim Valed As Integer Dim Valed As Integer
If Not Integer.TryParse(Str, Valed) Then Return "请输入一个整数!" If Not Integer.TryParse(Str, Valed) Then Return "请输入一个整数!"
If Str.Length > 9 Then Return "请输入一个大小合理的数字!"
If Valed > Max Then Return "不可超过 " & Max & "!" If Valed > Max Then Return "不可超过 " & Max & "!"
If Valed < Min Then Return "不可低于 " & Min & "!" If Valed < Min Then Return "不可低于 " & Min & "!"
Return "" Return ""