Dim uName As String = System.Web.HttpContext.Current.Server.UrlDecode(System.Web.HttpContext.Current.Request.Cookies(strCookieName)(strKeyName)) Dim objEnc As System.Text.Encoding = System.Text.Encoding.GetEncoding("GB2312") uName = System.Web.HttpUtility.UrlDecode(uName, objEnc)
Sub CleanCookies() Dim i As Integer Dim cookie As System.Web.HttpCookie For i = 0 To System.Web.HttpContext.Current.Request.Cookies.Count - 1 cookie = System.Web.HttpContext.Current.Request.Cookies(i) System.Web.HttpContext.Current.Response.Cookies(CStr(cookie.Name)).Value = "" System.Web.HttpContext.Current.Response.Cookies(CStr(cookie.Name)).Expires = DateAdd(DateInterval.Day, -1, Now) Next End Sub