随笔分类 -  asp.net

摘要:在ASP.NET MVC4中,为了在解开Controller和Model的耦合,我们通常需要在Controller激活系统中引入IoC,用于处理用户请求的 Controller,让Controller依赖于ModelRepository的抽象而不是它的实现。我们可以在三个阶段使用IoC实现上面所说的... 阅读全文
posted @ 2015-04-17 17:37 Ants 阅读(2069) 评论(0) 推荐(1) 编辑
摘要:原文地址:http://www.c-sharpcorner.com/uploadfile/736ca4/token-based-authentication-in-web-api-2/IntroductionThis article explains the OWIN OAuth 2.0 Autho... 阅读全文
posted @ 2015-01-30 10:57 Ants 阅读(2233) 评论(0) 推荐(0) 编辑
摘要:对于IIS6可以运行 iisapp -a来显示应用程序池的性能列表. iisapp.vbs它是一个脚本程序,在安装2003时需要SP1才有 而IIS7可以直接用它的外壳命令 C:"Windows"System32"inetsrv>appcmd.exe list wp来显示有时候因为服务器安全问题不能... 阅读全文
posted @ 2014-10-31 12:02 Ants 阅读(619) 评论(0) 推荐(0) 编辑
摘要:MiscWebSrvcInfClient client = new MiscWebSrvcInfClient("MiscWSBeanPort", ConfigurationManager.AppSettings["WSMiscService"]); u... 阅读全文
posted @ 2014-10-17 11:09 Ants 阅读(837) 评论(0) 推荐(0) 编辑
摘要:1: /******************************************************************************* 2: * InvokeHelper.cs 3: * A thread-safe control invoker helper class. 4: * -------------... 阅读全文
posted @ 2012-08-31 18:19 Ants 阅读(505) 评论(0) 推荐(0) 编辑
摘要:[原文作者]:Omar [原文链接]:Making best use of cache for high performance website使用URLs时要确保一致性 浏览器基于URL来缓存资源。当URL改变后,浏览器从源服务器获该资源的新的版本。查询字符串参数的改变也被视为URL的改变。例如,"/default.aspx" 被缓存到浏览器,如果你请求了"/default.aspx?123",浏览器将从服务器获取新的版本。对于这个新URL的响应,如果你返回的是正确的缓存报头,它仍然会被缓存。这样的话,再把查询字符串改成类似于"/defaul 阅读全文
posted @ 2012-03-29 12:23 Ants 阅读(595) 评论(0) 推荐(0) 编辑
摘要:1,首先建立购物车模型类: using System;using System.Collections.Generic;using System.Linq;using System.Web;namespace Ants.WebPart.Models{ public class ShopCarModel { public int Id { get; set; } ... 阅读全文
posted @ 2012-03-13 11:09 Ants 阅读(1436) 评论(2) 推荐(0) 编辑
摘要:在使用subsonic 3时,如果不完整安装SQLite的SDK包,直接在项目中使用System.Data.SQLite将引发上述错误。原因是:是 DBproviderfacotories 没有导致 解决的办法是手动在配制文件中指定 ,代码如下 :1<system.data>2<DbProviderFactories>3<removeinvariant="System.Data.SQLite"/>4<addname="SQLiteDataProvider"invariant="System.Data.S 阅读全文
posted @ 2011-03-24 12:05 Ants 阅读(4276) 评论(0) 推荐(1) 编辑
摘要:[原文链接:http://blog.s135.com/nginx_cache/]  Nginx从0.7.48版本开始,支持了类似Squid的缓存功能。这个缓存是把URL及相关组合当作Key,用md5编码哈希后保存在硬盘上,所以它可以支持任意URL链接,同时也支持404/301/302这样的非200状态码。虽然目前官方的Nginx Web缓存服务只能为指定URL或状态码设置过期时间,不支持类似Squ... 阅读全文
posted @ 2010-12-31 12:03 Ants 阅读(538) 评论(0) 推荐(0) 编辑
摘要:实现拦截器 在ASP.NET MVC中,有三种拦截器:Action拦截器、Result拦截器和Exception拦截器。其实所谓的ASP.NET MVC拦截器,也没什么神秘的,就是一个普通的类而已。只不过需要继承FilterAttribute基类,Action拦截器还要实现IActionFilter接口,而Exception拦截器需要实现IExceptionFilter接口。 我们先来看实现:让我... 阅读全文
posted @ 2010-12-22 13:41 Ants 阅读(1210) 评论(0) 推荐(0) 编辑
摘要:StructureMap 是一个非常灵巧的IOC框架,与asp.net MVC 更是很好的集成。 准备: 下载StructureMap,基本实例中只需要引用StructureMap.dll文件,并引用命名空间StructureMap下面是我们需要使用IoC的示例代码,我们要创建TestController,希望通过IoC为TestController的构造函数提供Ants.Provider.ICa... 阅读全文
posted @ 2010-12-22 11:08 Ants 阅读(1175) 评论(1) 推荐(0) 编辑
摘要:网略上广泛流传的三线性插值算法(效果并不是很好),代码如下:using System;using System.Drawing;using System.IO;using System.Drawing.Imaging;using System.Drawing.Drawing2D;namespace Ants.Tools{ public class Image { public int Width { get; set; } public int Height { get; set; } private Image() { } public Image(int width, int height 阅读全文
posted @ 2009-11-18 17:39 Ants 阅读(1891) 评论(4) 推荐(0) 编辑
摘要:备忘....SQL语句:table:表名test:要查的列(有重复的值)select * from table a where (select count(1) from table b where a.test=b.test)>1 阅读全文
posted @ 2009-04-15 14:46 Ants 阅读(796) 评论(0) 推荐(0) 编辑
摘要:[代码] 阅读全文
posted @ 2008-11-14 18:02 Ants 阅读(361) 评论(0) 推荐(0) 编辑
摘要:根据MSDN的说明linq实体类只支持DataContractAttribute 属性的序列化操作,也就是说他不支持XML与bin形式的序列化操作,这样就给我们在使用上带来了储多不便,比如有一个"Student"的linq实体类,当我们对它进行下面的操作是会发生错误:Student student = new Student(id=001, name="Ants", grade ="一年级");v... 阅读全文
posted @ 2008-10-20 14:33 Ants 阅读(2190) 评论(8) 推荐(0) 编辑
摘要:使用Memcached实现我们的分布式缓存方案。 阅读全文
posted @ 2008-07-30 23:06 Ants 阅读(3085) 评论(9) 推荐(0) 编辑
摘要:如何生成整齐,美观的缩略图? 阅读全文
posted @ 2008-06-27 12:06 Ants 阅读(5193) 评论(35) 推荐(1) 编辑
摘要:解决项目需求变化:如何应对数据表中字段的增加 阅读全文
posted @ 2008-06-23 15:18 Ants 阅读(4529) 评论(68) 推荐(0) 编辑
摘要:jquery与json的交互 阅读全文
posted @ 2008-06-17 15:41 Ants 阅读(19407) 评论(40) 推荐(2) 编辑
摘要:应用MS的API,创建与操作RSS订阅源(感谢@紫色永恒 让我知道啦还有这么个好东东 ) 阅读全文
posted @ 2008-06-14 17:21 Ants 阅读(2192) 评论(4) 推荐(0) 编辑

点击右上角即可分享
微信分享提示