//Deserialize<T>(String) 將JSON字符串轉化為類型T。
JavaScriptSerializer jss = new JavaScriptSerializer(); IList<IDictionary<string, string>> remarkContent = jss.Deserialize<IList<IDictionary<string, string>>>("字符串"); remarkContent = remarkContent == null ? new List<IDictionary<string, string>>() : remarkContent; IDictionary<string, string> _contentlist = new Dictionary<string, string>();
//向集合添加新的數據
_contentlist["Remark"] = Remark; _contentlist["CreateDate"] = timenow.ToString(); _contentlist["CreateBy"] = username; remarkContent.Add(_contentlist);
//轉為字符串
remarkList = jss.Serialize(remarkContent);