高分求教!COOKIE问题!!急!!

sliva 2005-05-25 01:22:22
在.net中查询ASP中COOKIE的值,包括用户名等信息,但是只要用户信息中包括“_”,就不能取到COOKIE中的信息,而其他用户名信息可以正常获取,已经搞了3天了,急呀!!
...全文
153 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
sliva 2005-05-25
  • 打赏
  • 举报
回复
OK,问题解决!
jimh 2005-05-25
  • 打赏
  • 举报
回复
使用Server.UrlDecode()
sliva 2005-05-25
  • 打赏
  • 举报
回复
发现COOKIE中含有“_”的东西转换成了“%5f”,但是对他进行dncode确仍然没有效果,不知道是什么东西?
sliva 2005-05-25
  • 打赏
  • 举报
回复
代码:
UserCookie _userCookie = userCookie;
try
{

_userCookie.UserName = Request.Cookies["test"]["username"];
_userCookie.Password = Request.Cookies["test"]["password"];
_userCookie.Blogid = Int32.Parse(Request.Cookies["test"]["CurrentID"].ToString());

userCookie = _userCookie;
}
catch
{
Response.Write(_msg);
return false;
}
if(_userCookie.UserName == null || _userCookie.UserName.Length == 0 || _userCookie.Password == null || _userCookie.Password.Length == 0)
{
Response.Write(_msg);
return false;
}
if(_userCookie.Blogid == -1)
{
Response.Write(_msg);
return false;
}
return true;
rheleven 2005-05-25
  • 打赏
  • 举报
回复
把你写COOKIE的代码贴出来阿
sliva 2005-05-25
  • 打赏
  • 举报
回复
顶,急呀!!!

111,097

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧