/// <summary>
/// Hashtable字典排序
/// </summary>
/// <param name="parameters"></param>
/// <param name="encode"></param>
/// <returns></returns>
public static string formatParameters(Hashtable parameters, Boolean encode)
{
StringBuilder sb = new StringBuilder();
ArrayList akeys = new ArrayList(parameters.Keys);
akeys.Sort();
foreach (string k in akeys)
{
string v = (string)parameters[k];//防止参数不是字符串
sb.Append(k.ToLower() + "=" + v + "&");
}
//去掉最后一个&
if (sb.Length > 0)
{
sb.Remove(sb.Length - 1, 1);
}
return sb.ToString();
}