下载后可任意编辑C#实现访客浏览历史记录(足迹)的方法:cookiestringcookie 记录用户浏览的 ID,格式为-1-2-3-4-5-
#region 存储 cookie set(key,value,days)public static bool set( string strName, string strValue, int strDay ){try{HttpCookie Cookie = new HttpCookie( strName );Cookie
Domain = GetHost(); /* 当 要 跨 域 名 访 问 的 时 候 , 给cookie指定域名即可,xxxx */Cookie
Expires = DateTime
AddDays( strDay );Cookie
Value = strValue;HttpContext
Current
Response
Cookies
Add( Cookie );return(true);}catch{return(false);}}#endregion#region 读取cookie值 get(key)public static string get( string strName ){HttpCookie Cookie = HttpContext
Current
Request
Cookies[strName];if ( Cookie
= null ){return(Cookie
ToString() );}else {return(null);}}#endregion#region 用 户 历 史 记 录 public static void history( string id ){varisHit= false;varhistory = Cookie
get( “histo