//使用www的库,读取数据里面的数据 string factoryControllerUrl = "http://IP地址:8086/DatabaseServerCode/GangShan.aspx"; WWWForm wwwF = new WWWForm(); wwwF.AddField("userName", "test"); HttpTask_DownDirect htd = new HttpTask_DownDirect(factoryControllerUrl, (w) => { var jsonData = MyJson.Parse(w.text); Debug.LogError(jsonData); if (jsonData == null) { return; } var state = jsonData.asDict()["state"].ToString(); if (state == "1") { foreach (var kk in jsonData.asDict()["nameList"].AsList()) { Gangshan item = new Gangshan(); item.id = kk.asDict()["id"].ToString(); item.name = kk.asDict()["name"].ToString(); item.sex = kk.asDict()["sex"].ToString(); item.age = kk.asDict()["age"].ToString(); StoreGangshanData.Add(item); } foreach (var hh in StoreGangshanData) { Debug.LogError(hh.id); Debug.LogError(hh.name); Debug.LogError(hh.age); Debug.LogError(hh.sex); } Debug.LogError(jsonData.asDict()["nameList"].AsList()[0].asDict()["name"].ToString()); } else { } },wwwform:wwwF); //FB.CloudSand.HttpMgr.Instance.AddTask(htd, 0);//添加一个任务,到频道255里面去