public void SetUserInfo(string sAccount, string sMD5PassWord) { HttpCookie cookie = new HttpCookie("UserInfo"); cookie.Expires = DateTime.Now.AddYears(1); Crypto3DES DesObject = new Crypto3DES(); DesObject.Key = sDESKey; cookie.Values.Add("account", DesObject.Encrypt3DES(sAccount)); cookie.Values.Add("pwd", DesObject.Encrypt3DES(sMD5PassWord)); Response.AppendCookie(cookie); }
public void setcookies(string sAccount, int iUserID) { Crypto3DES DesObject = new Crypto3DES(); DesObject.Key = sDESKey; Encoding enc = Encoding.GetEncoding("UTF-8"); Response.Cookies["UserID"].Value = DesObject.Encrypt3DES(iUserID.ToString()); Response.Cookies["UserID"].Expires = DateTime.Now.AddDays(1); Response.Cookies["Account"].Value = HttpUtility.UrlEncode(sAccount, enc); Response.Cookies["Account"].Expires = DateTime.Now.AddDays(1); Response.Cookies["logintime"].Value = DateTime.Now.ToString(); Response.Cookies["logintime"].Expires = DateTime.Now.AddDays(1); UserPoints upObject = UserPointsBLL.UPointsSel(iUserID); int iPoints = upObject.Points; int iGiftPoints = upObject.GiftPoints; SetPoints(iPoints + iGiftPoints); string sLoginInfo = GetUserLogin(iUserID); SetLogin(sLoginInfo); }