其他分享
首页 > 其他分享> > HttpContext Request 获取字符串参数乱码

HttpContext Request 获取字符串参数乱码

作者:互联网


HttpUtility.UrlDecode(参数);//把乱码的数据解码

/// <summary>
/// 获取数据
/// </summary>
/// <param name="context"></param>
public void GetData(HttpContext context)
{
	var str = HttpUtility.UrlDecode(context.Request["idStr"].ToString()); //解码一下就可以了
	
	var data = bll.GetData(str );

	context.Response.Write(data.ToJSON());
}

标签:UrlDecode,Request,乱码,context,var,HttpContext
来源: https://blog.csdn.net/qq_45195669/article/details/116376550