62,267
社区成员
发帖
与我相关
我的任务
分享
HttpCookie cookie = new HttpCookie("yonghu");
cookie.Values["userId"] = strUserId;
cookie.Values["pwd"] = strPwd;
cookie.Expires = DateTime.Now.AddYears(1);
Response.Cookies.Add(cookie);
string[] cookieArray = cookies.AllKeys;
for (int i = 0; i < cookieArray.Length; i++)
{
oneCookie = cookies[cookieArray[i]];
if (oneCookie.Name == "yonghu"))
{
string strIdPwd = oneCookie.Value;
string[] arrayIdPwd = strIdPwd.Split('&');
string[] arrayUserId = arrayIdPwd[0].Split('=');
string[] arrayPwd = arrayIdPwd[1].Split('=');
string strUserId = "", strPwd = "";
strUserId = arrayUserId[1];
strPwd = arrayPwd[1];
}
}
HttpCookie cookie = new HttpCookie("yonghu");
cookie.Values["userId"] = strUserId;
cookie.Values["pwd"] = strPwd;
cookie.Expires = DateTime.Now.AddYears(1);
Response.Cookies.Add(cookie);
string[] cookieArray = cookies.AllKeys;
for (int i = 0; i < cookieArray.Length; i++)
{
oneCookie = cookies[cookieArray[i]];
if (oneCookie.Name == "yonghu"))
{
string strIdPwd = oneCookie.Value;
string[] arrayIdPwd = strIdPwd.Split('&');
string[] arrayUserId = arrayIdPwd[0].Split('=');
string[] arrayPwd = arrayIdPwd[1].Split('=');
string strUserId = "", strPwd = "";
strUserId = arrayUserId[1];
strPwd = arrayPwd[1];
}