hirisw

博客园 首页 联系 订阅 管理

2012年10月30日

摘要: 使用:把控件拖到页面中,设置SavePath路径即可上传,如果还要扩展功能请继承此控件。。。后台代码:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.IO;namespace WebApplication1{ public partial class MutiFileUpload : System.Web.UI.UserControl { ... 阅读全文
posted @ 2012-10-30 11:35 hirisw 阅读(325) 评论(0) 推荐(0) 编辑

摘要: using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Reflection;using System.Text;using TCHRS.Server.Business.UserCode;using CommonCore.EntityCore;namespace Web.SendArchive{ public static class HMIHelper ... 阅读全文
posted @ 2012-10-30 10:52 hirisw 阅读(243) 评论(0) 推荐(0) 编辑

摘要: using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Reflection;using System.ComponentModel;using TCHRS.Web.Utility;namespace Web.SendArchive{ public class HMIFactory { /// <summary> /// ... 阅读全文
posted @ 2012-10-30 10:50 hirisw 阅读(276) 评论(0) 推荐(0) 编辑

2012年6月14日

摘要: public static class ClassExtender { private static Dictionary<Enum, double> unitDictionary; public static Dictionary<Enum, double> UnitDictionary { ge 阅读全文
posted @ 2012-06-14 21:05 hirisw 阅读(250) 评论(0) 推荐(0) 编辑

2012年6月5日

摘要: 共享一个从字符串转 Lambda 表达式的类(1)Posted on 2012-05-25 11:13 Lenic 阅读(1288) 评论(4) 编辑 收藏 记得在古老的 2.0 时代,如果想要不重新编译动态更改逻辑,有两种方式:第一种是插件式编程,第二种是使用 System.CodeDom.Compiler 空间下的动态编译功能。两种思路的核心思路差不多,都是实现接口,进而创建实例操作的。或许,还有第三种方式,恕我孤陋寡闻。然而,时代在进步,总会出现一些新的技术替换。在进入 3.0 之后,Lambda 表达式的出现,给我们一些新的思路,我们应该可以将这样的字符串【p => p.Firs 阅读全文
posted @ 2012-06-05 19:43 hirisw 阅读(198) 评论(0) 推荐(0) 编辑

摘要: 共享一个从字符串转 Lambda 表达式的类(2)Posted on 2012-05-29 12:33 Lenic 阅读(1469) 评论(12) 编辑 收藏 从这篇开始,我将按照依赖顺序,从核心到外围一步步说明这个东西。时间有点长,东西也不少。耐下心来看,或许能发现一些用得上的东西,当然不仅仅是在这里!从字符串解析为一个 Lambda 表达式树,第一步就是从中分析出有用的东西来。字符串【() => new int[6]】经过解析之后,我们会获得如下信息:左括号、索引值:0、文本表示:(右括号、索引值:1、文本表示:)Lambda 表达式前缀、索引值:3、文本表示:=>标识符、索引 阅读全文
posted @ 2012-06-05 19:42 hirisw 阅读(276) 评论(0) 推荐(1) 编辑

摘要: 承上篇的思路继续写,这次介绍字符串转 Type 的方式——类型分析。我的思路是把 Type 解析由“TestNet.Person, TestNet, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null” 这种复杂的方式改为 “Person” 这种。这样,写起来简单明了,看起来也简单明了。这次要说的东西比较简单,我借用一个例子说明:首先,字符串“TestNet.Person”经过解析被分析为下面的 Token 集合:标识、索引值 = 0、文本表示 = TestNet句点、索引值 = 7、文本表示 = .标识、索引值 = 8、文本表示 = P 阅读全文
posted @ 2012-06-05 19:36 hirisw 阅读(210) 评论(0) 推荐(0) 编辑

2012年5月13日

摘要: linq to sql生成not in语句的小技巧以前一直觉得linq to sql生成类似where id not in (1,3,5)或where id not in (select id from ...)这样的条件不是很方便,每次我都是把条件ID事先取到一个数组里,然后用 !Arr.Contains(c.Id)这样处理,今天突然发现这样好傻,其实可以完全直接用linq写成一句,贴个示例在这里,以后备查froma in TableA where !(fromb in TableB Where ... select b.Id).Contains(a.Id)最终翻译出来的语句并非跟not i 阅读全文
posted @ 2012-05-13 02:06 hirisw 阅读(135) 评论(0) 推荐(0) 编辑

2012年3月10日

摘要: using System; using System.Collections.Generic; using System.Threading; namespace _3vjDemos {//实现类: [Serializable] public class OrderedExecuteThread { public OrderedExecuteThrea... 阅读全文
posted @ 2012-03-10 12:43 hirisw 阅读(2204) 评论(0) 推荐(0) 编辑