源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

VB.NET校验字符串函数

  • 时间:2022-06-19 18:48 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:VB.NET校验字符串函数
[b]VB.NET校验字符串是否是日期[/b]
'Validate for a date
Shared Function checkdate(ByVal thisvalue As String) As String
  If Not IsDate(thisvalue) Then
    checkdate = "NULL"
  Else
    checkdate = "'" & thisvalue & "'"
  End If
  Return checkdate
End Function ' END checkdate

[b]VB.NET检查字符串是否是数字[/b]
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'Used to submit values to the database, check for empty value, replace w/ "NULL"
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
Shared Function checkNumber(ByVal thisvalue As String) As String
  If IsDBNull(thisvalue) Or Len(thisvalue) = 0 Or Not IsNumeric(thisvalue) Then
    checkNumber = "NULL"
  Else
    checkNumber = thisvalue
  End If
  Return checkNumber
End Function ' END checkNumber

以上所述就是本文的全部内容了,希望大家能够喜欢。
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部