设置的时候进行 Server.UrlEncode()编码 取出解码
解决方案 »
- 再次发帖问同样一个问题
- 动态创建listview的LayoutTemplate问题
- 关于src 和页面执行过程
- $("#ddlCategoryMain").val() text() html() 都不能取到选择项目的值
- 从数据库里读出Image并显示的问题。求助。
- SQL语句问题,请教
- 如何在web窗体内添加一个消息框,像vb中的messagebox,msgbox控件
- (求救)aspx页不显示正常结果,却显示完整源代码?(在线等)
- 有不有哪位老大做过类似与QQ的截图功能`
- 88分求一WebControls1.0中TreeView控件的例程,请打包发到我的邮箱。
- 求教datalist集中显示某一字段值的方法,急!
- 有没有数据库工程师、数据支持工程师、.NET开发主管
return Server.UrlDecode(System.Web.HttpContext.Current.Request.Cookies["DvForum"].Values["username"]);
举个例子
HttpContext.Current.Response.Charset = "utf-8";.... HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.UTF8;
{
HttpCookie MyCookie = new HttpCookie("DvForum");
MyCookie.Values["username"] = HttpUtility.UrlDecode(u.LoginName, System.Text.Encoding.GetEncoding("GB2312"));
//MyCookie.Values["username"] = u.LoginName;
MyCookie.Values["password"] = dt.Rows[0]["TruePassWord"].ToString();
MyCookie.Values["userid"] = dt.Rows[0]["userid"].ToString();
MyCookie.Values["isMaster"] = dt.Rows[0]["isMaster"].ToString();
MyCookie.Path = "/";
System.Web.HttpContext.Current.Response.Cookies.Add(MyCookie);
return true;
}
读
public static string UserName
{
//get { return _CookieValue().Split(',')[1].ToString(); } get
{
try
{ return System.Web.HttpContext.Current.Request.Cookies["DvForum"].Values["username"]; }
catch
{
return "";
}
}
}help!!!!!!!!!!!!!!
用不了Server
System.Web.HttpUtility.UrlDecode
System.Web.HttpUtility.UrlEncode