代码如下:
///
/// c# 参数名ascii码从小到大排序(字典序)拼接
///
///
///
public static string AsciiDicToStr(Dictionary dir)
{
string[] arrKeys = dir.Keys.ToArray();
Array.Sort(arrKeys, string.CompareOrdinal);
var sb = new StringBuilder();
foreach (var key in arrKeys)
{
string value = dir[key];
sb.Append(key + "=" + value + "&");
}
return sb.ToString().Substring(0, sb.ToString().Length - 1);
}
标签:string,c#,拼接,dir,key,sb,ascii,arrKeys
来源: https://www.cnblogs.com/Angel-szl/p/10753834.html