随笔分类 -  业务实现

【Attribute】自定义ValidationAttribute+扩展方法 实现类对象字段数据验证
摘要:常常有这样的需求:方法接受一个对象参数,要验证对象的所有字段的值是否合乎要求,如进行非空检测,长度检测等等。 比如,有这样一个Stu的类 new 一个 对象 作为参数进行传递 怎么来判断student的合法性呢?检测student的Name字段是否有值,检测FileBytes字段是否超出指定长度 1 阅读全文
posted @ 2017-06-15 17:27 布里渊区 阅读(1306) 评论(0) 推荐(0)
asp.net 每天的某时刻定时执行任务
摘要:1、在Global.asax文件中 的Application_Start 中定义一个线程 void Application_Start(object sender, EventArgs e) { // 在应用程序启动时运行的代码//定义一个线程 System.Threading.Thread LoadServiceData = new System.Threading.Thread(new System.Threading.ThreadStart(LoadFromWebservice)); LoadServiceData.Start(); ... 阅读全文
posted @ 2014-03-03 11:00 布里渊区 阅读(2454) 评论(1) 推荐(0)