2015年3月27日

C# System.Attribute(验证类)

摘要: 本文以一个项目中通用的验证类来举例说明如何使用自定义Attribute来扩展元数据。在项目中,我们为了保证各个层次之间的松藕合,通常把在各个层次之间传递数据的封装在一个称为实体类的类中,比如ActionFrom[csharp]view plaincopyusingSystem;namespaceAt... 阅读全文

posted @ 2015-03-27 22:29 大西瓜3721 阅读(693) 评论(0) 推荐(0)

C#:实体类中做数据验证

摘要: 主要是在实体类中验证using System;namespace Jone.Function.attribute{ /// /// 附加在数据实体用于描述如何验证合法性 /// [AttributeUsage(AttributeTargets.Field | AttributeTargets.P... 阅读全文

posted @ 2015-03-27 22:01 大西瓜3721 阅读(356) 评论(0) 推荐(0)

C#检验数据有效性验证类

摘要: using System;using System.Text;using System.Text.RegularExpressions;namespace Dachie.Common{ /// /// Common 的摘要说明。 /// public class RegexComm { //p... 阅读全文

posted @ 2015-03-27 21:06 大西瓜3721 阅读(515) 评论(0) 推荐(0)

C#常用操作类库一(验证类)

摘要: publicclassValidator{#region验证输入字符串为数字//////验证输入字符串为数字//////输入字符///返回一个bool类型的值publicstaticboolIsNumber(stringstrln){returnRegex.IsMatch(strln,"^([0]|... 阅读全文

posted @ 2015-03-27 21:02 大西瓜3721 阅读(226) 评论(0) 推荐(0)

导航