哈希表

传送门:https://www.cnblogs.com/xpvincent/archive/2013/01/15/2860841.html

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks; namespace ConsoleApp
{
class Program
{
static string hashToPostString(Hashtable ht) {
string str = "";
foreach (DictionaryEntry de in ht) {
str += de.Key + "=" + de.Value + "&";
}
return str.Substring(, str.Length - );
} static void Main(string[] args)
{
Hashtable ht = new Hashtable();
ht.Add("username", "");
ht.Add("password", "202063sb");
ht.Add("geetest_challenge", "3c2f03027eb7cac324a7cf67f148441d");
ht.Add("geetest_validate", "21fa24dfd285b955776fd349c5bc5834");
ht.Add("geetest_seccode", "21fa24dfd285b955776fd349c5bc5834|jordan"); string str = hashToPostString(ht);
Console.Write(str);
Console.ReadLine();
}
}
}

字典

传送门:http://blog.csdn.net/voodooer/article/details/19233105

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks; namespace ConsoleApp
{
class Program
{
static string DictionaryToPostString(Dictionary<string, string> ht) {
string str = "";
foreach (KeyValuePair<string, string> de in ht) {
str += de.Key + "=" + de.Value + "&";
}
return str.Substring(, str.Length - );
} static void Main(string[] args)
{ //定义字典
Dictionary<string, string> d = new Dictionary<string, string>();
d.Add("gt", "geetest.gt");
d.Add("challenge", "geetest.challenge");
d.Add("model", "");
d.Add("referer", "http://www.228.com.cn/auth/login");
d.Add("return", "json");
d.Add("user", "dragon8jiyan");
d.Add("pass", ""); string str = DictionaryToPostString(d);
Console.Write(str);
Console.ReadLine();
}
}
}

最新文章

  1. Android Studio —— 创建Menu菜单项
  2. iptables不生效解决办法
  3. QT通过IP地址定位地址(用get方法取数据)
  4. [译]Java垃圾回收是如何工作的
  5. /usr,/usr/local/ 还是 /opt ?
  6. Java RESTful 框架的性能比较
  7. MMU二级页表
  8. VS2015离线安装NuGet Package
  9. Sharepoint 2010 工作流状态值
  10. LeetCode题解之Balanced Binary Tree
  11. mvc:message-converters简单介绍
  12. CentOS下Yum的$releasever和$basearch的取值
  13. 配置Codis-Service主机
  14. Jackson JSON Processor
  15. shell 脚本调试
  16. java基础二 java的跨平台特性
  17. java之接口开发-初级篇-http和https
  18. endwith与startwith字符串方法匹配重写
  19. Struct2小组开发简单命名规范
  20. Linux下C程序进程地址空间布局[转]

热门文章

  1. .net 实用功能
  2. 版本控制[0] -&gt; git -&gt; 使用 git 进行版本控制
  3. [Python Cookbook] Pandas: 3 Ways to define a DataFrame
  4. 「kuangbin带你飞」专题十七 AC自动机
  5. Ext分区文件恢复工具extundelete
  6. the-swift-programming-language 学习笔记
  7. 【bzoj1485:】【 [HNOI2009]有趣的数列】模任意数的卡特兰数
  8. SQL 增删改查 复习
  9. About Markdown -- 进入Markdown园子
  10. 【NOIP模拟赛】【乱搞AC】【贪心】【模拟】匹配