日期:2014-05-17  浏览次数:20800 次

C# Combobox如何加载jsonString
最近做一个项目,用到了.net技术,请教大牛们,Combobox 怎么加载webservice返回的json格式的数据。

部分代码:


responseJson = ws.findFastMailDeliverPageList(requestJson);
Hashtable responseMap = JsonConvert.DeserializeObject<Hashtable>(responseJson);
string success = responseMap["success"].ToString(); // true
string msg = responseMap["msg"].ToString(); // null

// 快递列表

string lcList = responseMap["lcList"].ToString();


我的问题是如何把lcList中的快递加载到下拉框里。

谢谢!
.net webservice json

------解决方案--------------------
解析好json字符串并转为对象之后,就可以直接绑定到combobox了。
解析json
绑定代码(举个例子)
 this.comboBox1.DataSource = products;
            this.comboBox1.DisplayMember = "name";
            this.comboBox1.ValueMember = "num";