本文整理匯總了VB.NET中System.Configuration.RegexStringValidatorAttribute.ValidatorInstance屬性的典型用法代碼示例。如果您正苦於以下問題:VB.NET RegexStringValidatorAttribute.ValidatorInstance屬性的具體用法?VB.NET RegexStringValidatorAttribute.ValidatorInstance怎麽用?VB.NET RegexStringValidatorAttribute.ValidatorInstance使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類System.Configuration.RegexStringValidatorAttribute
的用法示例。
在下文中一共展示了RegexStringValidatorAttribute.ValidatorInstance屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: RegexStringValidatorAttribute
Dim valBase As _
ConfigurationValidatorBase
Dim rstrValAttr As _
New RegexStringValidatorAttribute("\w+\S*")
' Get the regular expression string.
Dim regex As String = _
rstrValAttr.Regex
Console.WriteLine( _
"Regular expression: {0}", regex)
Dim badValue As _
String = "&%$bbb"
Dim goodValue As _
String = "filename.txt"
Try
valBase = rstrValAttr.ValidatorInstance
valBase.Validate(goodValue)
' valBase.Validate(badValue);
Catch e As ArgumentException
' Display error message.
Dim msg As String = e.ToString()
#If DEBUG Then
Console.WriteLine(msg)
#End If
End Try '
開發者ID:VB.NET開發者,項目名稱:System.Configuration,代碼行數:30,代碼來源:RegexStringValidatorAttribute.ValidatorInstance