iplookup.cs

来自「《精通ASP.NET2.0网络应用系统开发》书中的源码」· CS 代码 · 共 37 行

CS
37
字号
using System;
using System.Web;

namespace webvisitStatistic.Reporter.IPLook
{
	/// <summary>
	/// IpLookUp 的摘要说明。
	/// </summary>
	public class IpLookup:IHttpHandler	
	{
		#region IHttpHandler
		/// <summary>
		/// document.write("");
		/// </summary>
		/// <param name="context"></param>
		public void ProcessRequest(HttpContext context) 
		{
			HttpRequest		request = context.Request;
			HttpResponse	response= context.Response;

			IpLookTable.IpPosition  pos = 
				IpLookTable.Instance().SearchIpPostion(request.QueryString["ip"]);
			
			response.Write( 
				"document.write(\""+pos.WidePos+ pos.NarrowPos + "\");");
		}		
		
		public bool IsReusable 
		{
			// To enable pooling, return true here.
			// This keeps the handler in memory.
			get { return true; }  
		}
		#endregion
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?