AspMVC服务端验证

来自站长百科
跳转至: 导航、​ 搜索

导航: 上一页

AspMVC服务端验证具体如下:

'三次基本校验
'是否为空
If (trim(Values) = "" and Arr(0)) Then 
CheckKey = GetLan(Val) & GetLan("null")
Exit Function
End If 

'是否是字符串
If (typename(Values)<> Arr(1)) Then 
AA = Arr(1)
CheckKey = GetLan(Val) & GetLan(AA)
Exit Function
End If 

'长度限制
If (Arr(2)<> -1) Then 
If (len(Values)> Arr(2)) Then 
CheckKey = GetLan(Val) & GetLan("len")
Exit Function
End If 
End If



Set Val = new Validata
users_email = "admin@@lelilin.com"
Response.Write("当前语言:" & Session("Language") & "<br>")
Response.Write("测试:users_email = "& users_email &"<br>")
Response.Write("测试结果:" & Val.Check("users_email",users_email))