示例:
- var _dic = new Dictionary<string, string>();
- _dic.Add("account", "");
- _dic.Add("channel", "ios");
- _dic.Add("facilityId", "4324235");
转出格式如下:
{"account":"","channel":"ios","facilityId":"4324235"}
解析方法:
-
- ///
- /// 整合数组
- ///
- private string IntegrationDic(Dictionary<string,string> _dic)
- {
- var _str = "";
- foreach (var idx in _dic) _str += "\"" + idx.Key + "\":" + "\"" + idx.Value + "\",";
- _str = _str.Substring(0, _str.Length - 1);
- _str = "{" + _str + "}";
- //Debug.Log(_str);
- return _str;
- }