05 2011 档案

Url重写小例
摘要:1.IHttpModule接口实现:namespace AspNetUnleashed{ public class UrlRemapper : IHttpModule { public void Init(HttpApplication app) { app.BeginRequest += new EventHandler(app_BeginRequest); } public void app_BeginRequest(Object s, EventArgs e) { // Get HTTP Context HttpApplication app = (HttpApplication)s; 阅读全文

posted @ 2011-05-13 01:16 Scarface 阅读(334) 评论(0) 推荐(0)

使用泛型查询数据小例
摘要:在这个例子当中,泛型的出色之处在于,不必为每个类型编写相同的代码讲阅读器的数据转换为泛型List。1.GenericMethods类public class GenericMethods{ public static List<T> GetListFromCommand<T>(SqlCommand command) where T : ICreatable, new() { List<T> list = new List<T>(); using (command.Connection) { command.Connection.Open(); S 阅读全文

posted @ 2011-05-09 02:47 Scarface 阅读(579) 评论(0) 推荐(0)

导航