随笔分类 -  asp.net2.0

摘要:一直以来都是用2005做网站,03还真没用过.这一段时间做了一个03项目,每天不断的上传dll到服务器上去搞的我大骂03太烦了,每次都用运行一下才编译.今天突然想到05虽然是在改了代码之后会重新编译,但它还是要生成一个*.dll.但它在bin目录中没有,于是我就开始找最后在C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET... 阅读全文
posted @ 2008-05-09 19:15 yejun 阅读(564) 评论(0) 推荐(1)
摘要:301跳转if (Request.Cookies["login"]==null){Response.Status ="301 Moved Permanently";Response.AddHeader("Location",http://www.zongen.com);}"蜘蛛"检测public static bool IsSpider(){DataSet ds=new DataSet();ds.... 阅读全文
posted @ 2008-03-20 18:53 yejun 阅读(1379) 评论(1) 推荐(0)
摘要:public static class ChineseCalendarHelper { public static string GetYear(DateTime time) { StringBuilder sb = new StringBuilder(); int year = calendar.GetYear(time); int d; do { d = year % 10; sb.Inser... 阅读全文
posted @ 2008-03-04 18:15 yejun 阅读(804) 评论(1) 推荐(0)
摘要:Request:能够获取表单和参数的值Request.Form:只能获取表单的值Request.QueryString:只能获取参数的值注意:控件ID不要和参数同名 阅读全文
posted @ 2008-02-29 10:58 yejun 阅读(546) 评论(0) 推荐(0)
摘要:因为要在项目中取到客户端IP,在网上搜了下相关资料,其中有一篇文章总结的比较详细,这里就把一些我用的上总结一下 方便以后查阅. 通常我们都通过下面的代码获得IP: string ip =System.Web.HttpContext.Current.Request.UserHostAddress; 或 string ip =System.Web.HttpContext.Current... 阅读全文
posted @ 2008-02-26 16:34 yejun 阅读(35254) 评论(7) 推荐(10)
摘要:Response.Write(Request.ServerVariables["SCRIPT_NAME"]); Response.Write(""); Response.Write(Request.Url.AbsolutePath); Response.Write(""); Response.Write(Reque... 阅读全文
posted @ 2008-02-22 15:39 yejun 阅读(256) 评论(0) 推荐(0)
摘要:先定义一个StaticFileCacheModule 实现IHttpModule接口 定制BeginRequest事件 public class StaticFileCacheModule:IHttpModule { public void Init(HttpApplication context) { context.BeginRequest += new Even... 阅读全文
posted @ 2008-02-17 14:00 yejun