摘要: 因为要在项目中取到客户端IP,在网上搜了下相关资料,其中有一篇文章总结的比较详细,这里就把一些我用的上总结一下 方便以后查阅. 通常我们都通过下面的代码获得IP: string ip =System.Web.HttpContext.Current.Request.UserHostAddress; 或 string ip =System.Web.HttpContext.Current... 阅读全文
posted @ 2008-02-26 16:34 yejun 阅读(35186) 评论(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 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 在C#2.0中属性的定义: private string _name = "ye"; public string Name { get { return _name; } set { _name = value; } } 只读 private string _name = "ye"; public string Nam... 阅读全文
posted @ 2008-02-19 10:50 yejun 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 1.#define和#undef #define ye 用来告诉编译器定义了一个符号,就象定义了一个变量,但这个变量并没有值 #undef ye 用来删除就个符号 #define和undef单独定义没什么意义,它主要配合#if和#endif使用 2.#if和#endif void DoSomeWork() { #if ye Console.WriteLine("do some ... 阅读全文
posted @ 2008-02-18 19:01 yejun 阅读(274) 评论(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 阅读(590) 评论(0) 推荐(0) 编辑