Asp.net源码专业站
首页->企业网站->中小企业网站系统前台源码(SmallBusinessStarterKit)>>smallbusiness_vb/App-Code/ProviderSettingsValidation.vb>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:中小企业网站系统前台源码(SmallBusinessStarterKit)
当前文件:文件类型 SmallBusinessStarterKit/smallbusiness_vb/App_Code/ProviderSettingsValidation.vb[1K,2009-6-12 11:54:22]打开代码结构图
普通视图
		            
1Imports System 2Imports System.Configuration 3 4'/ <summary> 5' ensures the providerCollection contains a set of ProviderSettings, where each one 6' "is a " Provider 7'/ </summary> 8Public Class ProviderSettingsValidation 9 Inherits ConfigurationValidatorBase 10 11 12 Public Overrides Function CanValidate(ByVal type As Type) As Boolean 13 Return GetType(ProviderSettingsCollection).Equals(type) 14 End Function 'CanValidate 15 16 17 '/ <summary> 18 ' validate the provider section 19 '/ </summary> 20 Public Overrides Sub Validate(ByVal value As Object) 21 Dim providerCollection As ProviderSettingsCollection = value 22 If Not (providerCollection Is Nothing) Then 23 Dim _provider As ProviderSettings 24 For Each _provider In providerCollection 25 26 If [String].IsNullOrEmpty(_provider.Type) Then 27 Throw New ConfigurationErrorsException("Type was not defined in the provider") 28 End If 29 30 Dim dataAccessType As Type = Type.GetType(_provider.Type) 31 If dataAccessType Is Nothing Then 32 Throw New InvalidOperationException("Provider's Type could not be found") 33 End If 34 Next _provider 35 End If 36 End Sub 'Validate 37End Class 'ProviderSettingsValidation
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:中小企业网站系统前台源码(SmallBusinessStarterKit)
51Aspx.com 版权所有 CopyRight © 2006-2010. 京ICP备06046876号 本站法律顾问:ITlaw-庄毅雄律师
返回顶部
客户服务:点击这里进行客户咨询 业务合作:点击这里洽谈业务合作 合作热线:010-68880146