惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Schneier on Security
有赞技术团队
有赞技术团队
T
The Blog of Author Tim Ferriss
F
Fortinet All Blogs
D
DataBreaches.Net
F
Full Disclosure
腾讯CDC
博客园 - 【当耐特】
MyScale Blog
MyScale Blog
Stack Overflow Blog
Stack Overflow Blog
小众软件
小众软件
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
爱范儿
爱范儿
The GitHub Blog
The GitHub Blog
Engineering at Meta
Engineering at Meta
大猫的无限游戏
大猫的无限游戏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
S
SegmentFault 最新的问题
The Register - Security
The Register - Security
WordPress大学
WordPress大学
博客园 - 聂微东
雷峰网
雷峰网
J
Java Code Geeks
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Privacy International News Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
A
Arctic Wolf
Scott Helme
Scott Helme
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tor Project blog
博客园 - 三生石上(FineUI控件)
Know Your Adversary
Know Your Adversary
AWS News Blog
AWS News Blog
G
Google Developers Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
CERT Recently Published Vulnerability Notes
O
OpenAI News
Project Zero
Project Zero
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Application and Cybersecurity Blog
Application and Cybersecurity Blog
云风的 BLOG
云风的 BLOG
N
News and Events Feed by Topic
MongoDB | Blog
MongoDB | Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Microsoft Security Blog
Microsoft Security Blog
Cisco Talos Blog
Cisco Talos Blog
P
Palo Alto Networks Blog
Schneier on Security
Schneier on Security

博客园 - 北极燕鸥

探析使用国密算法进行个人信息保护 web通过ActiveX打印 iBatis.Net(C#)系列Demo源码 [原]iBatis.Net(C#)系列三:数据库查询 [原]iBatis.Net(C#)系列二:SQL数据映射 [原]iBatis.Net(C#)系列一:简介及运行环境 使用X.509数字证书加密解密实务(三)-- 使用RSA证书结合对称加密技术加密长数据(转) 使用X.509数字证书加密解密实务(二)-- 使用RSA证书加密敏感数据(转) 使用X.509数字证书加密解密实务(一)-- 证书的获得和管理 (转) moto 工作用脚本 DB2的数据字典 DB2批量清空数据表 ARC GIS 打开cad文件的几种方法 c# 连接MySQL中文乱码问题的解决方法 DB2 export和import Xmanager连接AIX 5L RedHat Enterprise Linux 基本网络配置 AIX :卷组、逻辑卷、物理卷的操作命令
url 编码问题
北极燕鸥 · 2010-03-29 · via 博客园 - 北极燕鸥

在ASP.Net中,Request.QueryString是System.Collections.Specialized.NameValueCollection类型,默认它是经过UTF-8解码的。如果你的url中的参数用的是GBK编码,将会在QueryString中得到一串乱码。

怎么办?

自己读原始的Query然后去解析?

不用那么复杂,Framework已经帮你做好了处理的方法:

string query = this.Request.Url.Query;

 System.Collections.Specialized.NameValueCollection queryString = System.Web.HttpUtility.ParseQueryString(query, System.Text.Encoding.GetEncoding("GBK"));

这样queryString 这个集合中就是经过GBK解码的字符了。