If Len(s) = 18 Then v1 = Split("7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2", ",") v2 = Split("1,0,X,9,8,7,6,5,4,3,2", ",") For i = 1 To 17 c1 = c1 + Mid(s, i, 1) * v1(i - 1) Next i c1 = c1 Mod 11 If v2(c1) = Mid(s, 18, 1) Then Label1.Caption = "校验结果:【 校验成功 ! 】" Text2.Text = s Else Label1.Caption = "校验结果:【 不合法 ! 系统在下面已经给出正确值 】" Text2.Text = Left(s, 17) & v2(c1) End If Else Label1.Caption = "校验结果:【 错误 ! 长度应该是 18 位数,您输入的是: " & Len(s) & " 位数 】" Text2.Text = "" End If