最好的办法,采取一切查询字符串对和初始化字典 [英] Best way to take all querystring pairs and init a dictionary
本文介绍了最好的办法,采取一切查询字符串对和初始化字典的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想所有的键/值对存储在我的查询字符串:
I want to store all the key/value pairs in my querystring:
www.example.com/?a=2&b=3&c=34
成一本字典。是否有这样做的w / o通过所有项目无需手动循环?
into a dictionary. Is there a quick way of doing this w/o having to manually cycle through all the items?
推荐答案
尝试<$ C $的快捷方式C> HttpUtility.ParseQueryString()。
它给你回一个的NameValueCollection $ C $的c>您的关键字和值。
It gives you back a NameValueCollection
of your keys and values.
这篇关于最好的办法,采取一切查询字符串对和初始化字典的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文