省市区结构

实体

/// <summary>
/// 行政区
/// </summary>
public class AreaEntity
{
public int Id { get; set; }
/// <summary>
/// 名称
/// </summary>
public string RegionName { get; set; } /// <summary>
/// 编码
/// </summary>
public string RegionCode { get; set; } /// <summary>
/// 上级编码
/// </summary>
public string ParentCode { get; set; } public string Longitude { get; set; }
public string Latitude { get; set; } } public class AreaModel
{
/// <summary>
/// 名称
/// </summary>
public string RegionName { get; set; } /// <summary>
/// 编码
/// </summary>
public string RegionCode { get; set; } /// <summary>
/// 上级编码
/// </summary>
public string ParentCode { get; set; } public AreaModel[] Children { get; set; } }

 C# 代码

        /// <summary>
/// 获取所属获取信息
/// </summary>
/// <param name="parentCode">所属编码</param>
/// <returns>列表</returns>
public AreaEntity[] GetAreaModelList(string parentCode)
{ StringBuilder strSQL = new StringBuilder();
strSQL.Append(" select * from [dbo].[Area] With(nolock) ");
strSQL.Append(" WHERE ParentCode=@ParentCode"); var param = new SqlParameter[] {
new SqlParameter("@ParentCode",SqlDbType.VarChar)
};
param[0].Value = parentCode; AreaEntity[] list = null;
using (var context = new YTODBDbContext())
{
list = context.Database.SqlQuery<AreaEntity>(strSQL.ToString(), param).ToArray(); }
return list; }
/// <summary>
/// 生成树的方法
/// </summary>
/// <param name="parentCode">所属编码</param>
/// <param name="areaModel">信息</param>
/// <returns></returns>
public AreaModel creatTheTree(string parentCode, AreaModel areaModel)
{
AreaEntity[] items = GetAreaModelList(parentCode);
//如果没有字节点了,那就返回空
if (items.Length == 0)
return null;
List<AreaModel> jdList = new List<AreaModel>();
for (int i = 0; i < items.Length; i++)
{
AreaModel jiedian = new AreaModel();
jiedian.RegionName = items[i].RegionName;
jiedian.RegionCode = items[i].RegionCode;
jiedian.ParentCode = items[i].ParentCode;
//递归循环
creatTheTree(items[i].RegionCode.ToString(), jiedian);
jdList.Add(jiedian);
}
areaModel.Children = jdList.ToArray();
return areaModel;
}

  接口调用

        public HttpResponseMessage getAreaInfo(AreaInfoViewModel req)
{
//var userinfo = GetCurrentLoginInfo();
//if (userinfo.RoleId != FlagMgr.UnitRole.Type.Agricultural.ToInt())
//{
// return ResponseError("权限不匹配!");
//} var AreaModel = _areaService.GetAreaModelList(req.RegionCode);
var tempAreaModel = new AreaModel();
tempAreaModel.RegionName = AreaModel[0].RegionName;
tempAreaModel.RegionCode = AreaModel[0].RegionCode;
tempAreaModel.ParentCode = AreaModel[0].ParentCode;
//递归树结构
var areaModel = _areaService.creatTheTree(req.RegionCode, tempAreaModel);
return ResponseOK<AreaModel>(areaModel);
}

  返回数据

{
"mStatusCode": 200,
"mStatusDesc": "OK",
"mDataBody": {
"RegionName": "济南市",
"RegionCode": "370100",
"ParentCode": "370000",
"Children": [
{
"RegionName": "济南市",
"RegionCode": "370100",
"ParentCode": "370000",
"Children": [
{
"RegionName": "市辖区",
"RegionCode": "370101",
"ParentCode": "370100",
"Children": null
},
{
"RegionName": "历下区",
"RegionCode": "370102",
"ParentCode": "370100",
"Children": null
},
{
"RegionName": "市中区",
"RegionCode": "370103",
"ParentCode": "370100",
"Children": null
},
{
"RegionName": "槐荫区",
"RegionCode": "370104",
"ParentCode": "370100",
"Children": null
},
{
"RegionName": "天桥区",
"RegionCode": "370105",
"ParentCode": "370100",
"Children": null
},
{
"RegionName": "历城区",
"RegionCode": "370112",
"ParentCode": "370100",
"Children": null
},
{
"RegionName": "长清区",
"RegionCode": "370113",
"ParentCode": "370100",
"Children": null
},
{
"RegionName": "平阴县",
"RegionCode": "370124",
"ParentCode": "370100",
"Children": null
},
{
"RegionName": "济阳县",
"RegionCode": "370125",
"ParentCode": "370100",
"Children": null
},
{
"RegionName": "商河县",
"RegionCode": "370126",
"ParentCode": "370100",
"Children": null
},
{
"RegionName": "章丘市",
"RegionCode": "370181",
"ParentCode": "370100",
"Children": null
}
]
},
{
"RegionName": "青岛市",
"RegionCode": "370200",
"ParentCode": "370000",
"Children": [
{
"RegionName": "市辖区",
"RegionCode": "370201",
"ParentCode": "370200",
"Children": null
},
{
"RegionName": "市南区",
"RegionCode": "370202",
"ParentCode": "370200",
"Children": null
},
{
"RegionName": "市北区",
"RegionCode": "370203",
"ParentCode": "370200",
"Children": null
},
{
"RegionName": "黄岛区",
"RegionCode": "370211",
"ParentCode": "370200",
"Children": null
},
{
"RegionName": "崂山区",
"RegionCode": "370212",
"ParentCode": "370200",
"Children": null
},
{
"RegionName": "李沧区",
"RegionCode": "370213",
"ParentCode": "370200",
"Children": null
},
{
"RegionName": "城阳区",
"RegionCode": "370214",
"ParentCode": "370200",
"Children": null
},
{
"RegionName": "胶州市",
"RegionCode": "370281",
"ParentCode": "370200",
"Children": null
},
{
"RegionName": "即墨市",
"RegionCode": "370282",
"ParentCode": "370200",
"Children": null
},
{
"RegionName": "平度市",
"RegionCode": "370283",
"ParentCode": "370200",
"Children": null
},
{
"RegionName": "莱西市",
"RegionCode": "370285",
"ParentCode": "370200",
"Children": null
}
]
},
{
"RegionName": "淄博市",
"RegionCode": "370300",
"ParentCode": "370000",
"Children": [
{
"RegionName": "市辖区",
"RegionCode": "370301",
"ParentCode": "370300",
"Children": null
},
{
"RegionName": "淄川区",
"RegionCode": "370302",
"ParentCode": "370300",
"Children": null
},
{
"RegionName": "张店区",
"RegionCode": "370303",
"ParentCode": "370300",
"Children": null
},
{
"RegionName": "博山区",
"RegionCode": "370304",
"ParentCode": "370300",
"Children": null
},
{
"RegionName": "临淄区",
"RegionCode": "370305",
"ParentCode": "370300",
"Children": null
},
{
"RegionName": "周村区",
"RegionCode": "370306",
"ParentCode": "370300",
"Children": null
},
{
"RegionName": "桓台县",
"RegionCode": "370321",
"ParentCode": "370300",
"Children": null
},
{
"RegionName": "高青县",
"RegionCode": "370322",
"ParentCode": "370300",
"Children": null
},
{
"RegionName": "沂源县",
"RegionCode": "370323",
"ParentCode": "370300",
"Children": null
}
]
},
{
"RegionName": "枣庄市",
"RegionCode": "370400",
"ParentCode": "370000",
"Children": [
{
"RegionName": "市辖区",
"RegionCode": "370401",
"ParentCode": "370400",
"Children": null
},
{
"RegionName": "市中区",
"RegionCode": "370402",
"ParentCode": "370400",
"Children": null
},
{
"RegionName": "薛城区",
"RegionCode": "370403",
"ParentCode": "370400",
"Children": null
},
{
"RegionName": "峄城区",
"RegionCode": "370404",
"ParentCode": "370400",
"Children": null
},
{
"RegionName": "台儿庄区",
"RegionCode": "370405",
"ParentCode": "370400",
"Children": null
},
{
"RegionName": "山亭区",
"RegionCode": "370406",
"ParentCode": "370400",
"Children": null
},
{
"RegionName": "滕州市",
"RegionCode": "370481",
"ParentCode": "370400",
"Children": null
}
]
},
{
"RegionName": "东营市",
"RegionCode": "370500",
"ParentCode": "370000",
"Children": [
{
"RegionName": "市辖区",
"RegionCode": "370501",
"ParentCode": "370500",
"Children": null
},
{
"RegionName": "东营区",
"RegionCode": "370502",
"ParentCode": "370500",
"Children": null
},
{
"RegionName": "河口区",
"RegionCode": "370503",
"ParentCode": "370500",
"Children": null
},
{
"RegionName": "垦利县",
"RegionCode": "370521",
"ParentCode": "370500",
"Children": null
},
{
"RegionName": "利津县",
"RegionCode": "370522",
"ParentCode": "370500",
"Children": null
},
{
"RegionName": "广饶县",
"RegionCode": "370523",
"ParentCode": "370500",
"Children": null
}
]
},
{
"RegionName": "烟台市",
"RegionCode": "370600",
"ParentCode": "370000",
"Children": [
{
"RegionName": "市辖区",
"RegionCode": "370601",
"ParentCode": "370600",
"Children": null
},
{
"RegionName": "芝罘区",
"RegionCode": "370602",
"ParentCode": "370600",
"Children": null
},
{
"RegionName": "福山区",
"RegionCode": "370611",
"ParentCode": "370600",
"Children": null
},
{
"RegionName": "牟平区",
"RegionCode": "370612",
"ParentCode": "370600",
"Children": null
},
{
"RegionName": "莱山区",
"RegionCode": "370613",
"ParentCode": "370600",
"Children": null
},
{
"RegionName": "长岛县",
"RegionCode": "370634",
"ParentCode": "370600",
"Children": null
},
{
"RegionName": "龙口市",
"RegionCode": "370681",
"ParentCode": "370600",
"Children": null
},
{
"RegionName": "莱阳市",
"RegionCode": "370682",
"ParentCode": "370600",
"Children": null
},
{
"RegionName": "莱州市",
"RegionCode": "370683",
"ParentCode": "370600",
"Children": null
},
{
"RegionName": "蓬莱市",
"RegionCode": "370684",
"ParentCode": "370600",
"Children": null
},
{
"RegionName": "招远市",
"RegionCode": "370685",
"ParentCode": "370600",
"Children": null
},
{
"RegionName": "栖霞市",
"RegionCode": "370686",
"ParentCode": "370600",
"Children": null
},
{
"RegionName": "海阳市",
"RegionCode": "370687",
"ParentCode": "370600",
"Children": null
}
]
},
{
"RegionName": "潍坊市",
"RegionCode": "370700",
"ParentCode": "370000",
"Children": [
{
"RegionName": "市辖区",
"RegionCode": "370701",
"ParentCode": "370700",
"Children": null
},
{
"RegionName": "潍城区",
"RegionCode": "370702",
"ParentCode": "370700",
"Children": null
},
{
"RegionName": "寒亭区",
"RegionCode": "370703",
"ParentCode": "370700",
"Children": null
},
{
"RegionName": "坊子区",
"RegionCode": "370704",
"ParentCode": "370700",
"Children": null
},
{
"RegionName": "奎文区",
"RegionCode": "370705",
"ParentCode": "370700",
"Children": null
},
{
"RegionName": "临朐县",
"RegionCode": "370724",
"ParentCode": "370700",
"Children": null
},
{
"RegionName": "昌乐县",
"RegionCode": "370725",
"ParentCode": "370700",
"Children": null
},
{
"RegionName": "青州市",
"RegionCode": "370781",
"ParentCode": "370700",
"Children": null
},
{
"RegionName": "诸城市",
"RegionCode": "370782",
"ParentCode": "370700",
"Children": null
},
{
"RegionName": "寿光市",
"RegionCode": "370783",
"ParentCode": "370700",
"Children": null
},
{
"RegionName": "安丘市",
"RegionCode": "370784",
"ParentCode": "370700",
"Children": null
},
{
"RegionName": "高密市",
"RegionCode": "370785",
"ParentCode": "370700",
"Children": null
},
{
"RegionName": "昌邑市",
"RegionCode": "370786",
"ParentCode": "370700",
"Children": null
}
]
},
{
"RegionName": "济宁市",
"RegionCode": "370800",
"ParentCode": "370000",
"Children": [
{
"RegionName": "市辖区",
"RegionCode": "370801",
"ParentCode": "370800",
"Children": null
},
{
"RegionName": "任城区",
"RegionCode": "370811",
"ParentCode": "370800",
"Children": null
},
{
"RegionName": "兖州区",
"RegionCode": "370812",
"ParentCode": "370800",
"Children": null
},
{
"RegionName": "微山县",
"RegionCode": "370826",
"ParentCode": "370800",
"Children": null
},
{
"RegionName": "鱼台县",
"RegionCode": "370827",
"ParentCode": "370800",
"Children": null
},
{
"RegionName": "金乡县",
"RegionCode": "370828",
"ParentCode": "370800",
"Children": null
},
{
"RegionName": "嘉祥县",
"RegionCode": "370829",
"ParentCode": "370800",
"Children": null
},
{
"RegionName": "汶上县",
"RegionCode": "370830",
"ParentCode": "370800",
"Children": null
},
{
"RegionName": "泗水县",
"RegionCode": "370831",
"ParentCode": "370800",
"Children": null
},
{
"RegionName": "梁山县",
"RegionCode": "370832",
"ParentCode": "370800",
"Children": null
},
{
"RegionName": "曲阜市",
"RegionCode": "370881",
"ParentCode": "370800",
"Children": null
},
{
"RegionName": "邹城市",
"RegionCode": "370883",
"ParentCode": "370800",
"Children": null
}
]
},
{
"RegionName": "泰安市",
"RegionCode": "370900",
"ParentCode": "370000",
"Children": [
{
"RegionName": "市辖区",
"RegionCode": "370901",
"ParentCode": "370900",
"Children": null
},
{
"RegionName": "泰山区",
"RegionCode": "370902",
"ParentCode": "370900",
"Children": null
},
{
"RegionName": "岱岳区",
"RegionCode": "370911",
"ParentCode": "370900",
"Children": null
},
{
"RegionName": "宁阳县",
"RegionCode": "370921",
"ParentCode": "370900",
"Children": null
},
{
"RegionName": "东平县",
"RegionCode": "370923",
"ParentCode": "370900",
"Children": null
},
{
"RegionName": "新泰市",
"RegionCode": "370982",
"ParentCode": "370900",
"Children": null
},
{
"RegionName": "肥城市",
"RegionCode": "370983",
"ParentCode": "370900",
"Children": null
}
]
},
{
"RegionName": "威海市",
"RegionCode": "371000",
"ParentCode": "370000",
"Children": [
{
"RegionName": "市辖区",
"RegionCode": "371001",
"ParentCode": "371000",
"Children": null
},
{
"RegionName": "环翠区",
"RegionCode": "371002",
"ParentCode": "371000",
"Children": null
},
{
"RegionName": "文登区",
"RegionCode": "371003",
"ParentCode": "371000",
"Children": null
},
{
"RegionName": "荣成市",
"RegionCode": "371082",
"ParentCode": "371000",
"Children": null
},
{
"RegionName": "乳山市",
"RegionCode": "371083",
"ParentCode": "371000",
"Children": null
}
]
},
{
"RegionName": "日照市",
"RegionCode": "371100",
"ParentCode": "370000",
"Children": [
{
"RegionName": "市辖区",
"RegionCode": "371101",
"ParentCode": "371100",
"Children": null
},
{
"RegionName": "东港区",
"RegionCode": "371102",
"ParentCode": "371100",
"Children": null
},
{
"RegionName": "岚山区",
"RegionCode": "371103",
"ParentCode": "371100",
"Children": null
},
{
"RegionName": "五莲县",
"RegionCode": "371121",
"ParentCode": "371100",
"Children": null
},
{
"RegionName": "莒县",
"RegionCode": "371122",
"ParentCode": "371100",
"Children": null
}
]
},
{
"RegionName": "莱芜市",
"RegionCode": "371200",
"ParentCode": "370000",
"Children": [
{
"RegionName": "市辖区",
"RegionCode": "371201",
"ParentCode": "371200",
"Children": null
},
{
"RegionName": "莱城区",
"RegionCode": "371202",
"ParentCode": "371200",
"Children": null
},
{
"RegionName": "钢城区",
"RegionCode": "371203",
"ParentCode": "371200",
"Children": null
}
]
},
{
"RegionName": "临沂市",
"RegionCode": "371300",
"ParentCode": "370000",
"Children": [
{
"RegionName": "市辖区",
"RegionCode": "371301",
"ParentCode": "371300",
"Children": null
},
{
"RegionName": "兰山区",
"RegionCode": "371302",
"ParentCode": "371300",
"Children": null
},
{
"RegionName": "罗庄区",
"RegionCode": "371311",
"ParentCode": "371300",
"Children": null
},
{
"RegionName": "河东区",
"RegionCode": "371312",
"ParentCode": "371300",
"Children": null
},
{
"RegionName": "沂南县",
"RegionCode": "371321",
"ParentCode": "371300",
"Children": null
},
{
"RegionName": "郯城县",
"RegionCode": "371322",
"ParentCode": "371300",
"Children": null
},
{
"RegionName": "沂水县",
"RegionCode": "371323",
"ParentCode": "371300",
"Children": null
},
{
"RegionName": "兰陵县",
"RegionCode": "371324",
"ParentCode": "371300",
"Children": null
},
{
"RegionName": "费县",
"RegionCode": "371325",
"ParentCode": "371300",
"Children": null
},
{
"RegionName": "平邑县",
"RegionCode": "371326",
"ParentCode": "371300",
"Children": null
},
{
"RegionName": "莒南县",
"RegionCode": "371327",
"ParentCode": "371300",
"Children": null
},
{
"RegionName": "蒙阴县",
"RegionCode": "371328",
"ParentCode": "371300",
"Children": null
},
{
"RegionName": "临沭县",
"RegionCode": "371329",
"ParentCode": "371300",
"Children": null
}
]
},
{
"RegionName": "德州市",
"RegionCode": "371400",
"ParentCode": "370000",
"Children": [
{
"RegionName": "市辖区",
"RegionCode": "371401",
"ParentCode": "371400",
"Children": null
},
{
"RegionName": "德城区",
"RegionCode": "371402",
"ParentCode": "371400",
"Children": null
},
{
"RegionName": "陵城区",
"RegionCode": "371403",
"ParentCode": "371400",
"Children": null
},
{
"RegionName": "宁津县",
"RegionCode": "371422",
"ParentCode": "371400",
"Children": null
},
{
"RegionName": "庆云县",
"RegionCode": "371423",
"ParentCode": "371400",
"Children": null
},
{
"RegionName": "临邑县",
"RegionCode": "371424",
"ParentCode": "371400",
"Children": null
},
{
"RegionName": "齐河县",
"RegionCode": "371425",
"ParentCode": "371400",
"Children": null
},
{
"RegionName": "平原县",
"RegionCode": "371426",
"ParentCode": "371400",
"Children": null
},
{
"RegionName": "夏津县",
"RegionCode": "371427",
"ParentCode": "371400",
"Children": null
},
{
"RegionName": "武城县",
"RegionCode": "371428",
"ParentCode": "371400",
"Children": null
},
{
"RegionName": "乐陵市",
"RegionCode": "371481",
"ParentCode": "371400",
"Children": null
},
{
"RegionName": "禹城市",
"RegionCode": "371482",
"ParentCode": "371400",
"Children": null
}
]
},
{
"RegionName": "聊城市",
"RegionCode": "371500",
"ParentCode": "370000",
"Children": [
{
"RegionName": "市辖区",
"RegionCode": "371501",
"ParentCode": "371500",
"Children": null
},
{
"RegionName": "东昌府区",
"RegionCode": "371502",
"ParentCode": "371500",
"Children": null
},
{
"RegionName": "阳谷县",
"RegionCode": "371521",
"ParentCode": "371500",
"Children": null
},
{
"RegionName": "莘县",
"RegionCode": "371522",
"ParentCode": "371500",
"Children": null
},
{
"RegionName": "茌平县",
"RegionCode": "371523",
"ParentCode": "371500",
"Children": null
},
{
"RegionName": "东阿县",
"RegionCode": "371524",
"ParentCode": "371500",
"Children": null
},
{
"RegionName": "冠县",
"RegionCode": "371525",
"ParentCode": "371500",
"Children": null
},
{
"RegionName": "高唐县",
"RegionCode": "371526",
"ParentCode": "371500",
"Children": null
},
{
"RegionName": "临清市",
"RegionCode": "371581",
"ParentCode": "371500",
"Children": null
}
]
},
{
"RegionName": "滨州市",
"RegionCode": "371600",
"ParentCode": "370000",
"Children": [
{
"RegionName": "市辖区",
"RegionCode": "371601",
"ParentCode": "371600",
"Children": null
},
{
"RegionName": "滨城区",
"RegionCode": "371602",
"ParentCode": "371600",
"Children": null
},
{
"RegionName": "沾化区",
"RegionCode": "371603",
"ParentCode": "371600",
"Children": null
},
{
"RegionName": "惠民县",
"RegionCode": "371621",
"ParentCode": "371600",
"Children": null
},
{
"RegionName": "阳信县",
"RegionCode": "371622",
"ParentCode": "371600",
"Children": null
},
{
"RegionName": "无棣县",
"RegionCode": "371623",
"ParentCode": "371600",
"Children": null
},
{
"RegionName": "博兴县",
"RegionCode": "371625",
"ParentCode": "371600",
"Children": null
},
{
"RegionName": "邹平县",
"RegionCode": "371626",
"ParentCode": "371600",
"Children": null
}
]
},
{
"RegionName": "菏泽市",
"RegionCode": "371700",
"ParentCode": "370000",
"Children": [
{
"RegionName": "市辖区",
"RegionCode": "371701",
"ParentCode": "371700",
"Children": null
},
{
"RegionName": "牡丹区",
"RegionCode": "371702",
"ParentCode": "371700",
"Children": null
},
{
"RegionName": "曹县",
"RegionCode": "371721",
"ParentCode": "371700",
"Children": null
},
{
"RegionName": "单县",
"RegionCode": "371722",
"ParentCode": "371700",
"Children": null
},
{
"RegionName": "成武县",
"RegionCode": "371723",
"ParentCode": "371700",
"Children": null
},
{
"RegionName": "巨野县",
"RegionCode": "371724",
"ParentCode": "371700",
"Children": null
},
{
"RegionName": "郓城县",
"RegionCode": "371725",
"ParentCode": "371700",
"Children": null
},
{
"RegionName": "鄄城县",
"RegionCode": "371726",
"ParentCode": "371700",
"Children": null
},
{
"RegionName": "定陶县",
"RegionCode": "371727",
"ParentCode": "371700",
"Children": null
},
{
"RegionName": "东明县",
"RegionCode": "371728",
"ParentCode": "371700",
"Children": null
}
]
}
]
}
}

  

使用过多的递归出现错误,“System.StackOverflowException”,由于递归数据放在栈里,递归不断的压栈,.NET framework Runtime 就抛出异常。

递归算法解题的运行效率较低。在递归调用的过程当中系统为每一层的返回点、局部量等开辟了栈来存储。递归次数过多容易造成栈溢出等。

C# 递归省市区三级树结构的更多相关文章

  1. [C#]使用 C# 代码实现拓扑排序 dotNet Core WEB程序使用 Nginx反向代理 C#里面获得应用程序的当前路径 关于Nginx设置端口号,在Asp.net 获取不到的,解决办法 .Net程序员 初学Ubuntu ,配置Nignix 夜深了,写了个JQuery的省市区三级级联效果

    [C#]使用 C# 代码实现拓扑排序   目录 0.参考资料 1.介绍 2.原理 3.实现 4.深度优先搜索实现 回到顶部 0.参考资料 尊重他人的劳动成果,贴上参考的资料地址,本文仅作学习记录之用. ...

  2. jQuery省市区三级联动插件

    体验效果:http://hovertree.com/texiao/bootstrap/4/支持PC和手机移动端. 手机扫描二维码体验效果: 代码如下: <!DOCTYPE html> &l ...

  3. 省市区三级联动 pickerView

    效果图 概述 关于 省市区 三级联动的 pickerView,我想大多数的 iOS 开发者应该都遇到过这样的需求.在遇到这样的需求的时候,大多数人都会觉的这个很复杂,一时无从下手.其实真的没那么复杂. ...

  4. JS省市区三级联动

    不需要访问后台服务器端,不使用Ajax,无刷新,纯JS实现的省市区三级联动. 当省市区数据变动是只需调正js即可. 使用方法: <!DOCTYPE html><html>< ...

  5. ajax省市区三级联动

    jdbc+servlet+ajax开发省市区三级联动 技术点:jdbc操作数据库,ajax提交,字符拦截器,三级联动 特点:局部刷新达到省市区三级联动,举一反三可以做商品分类等 宗旨:从实战中学习 博 ...

  6. QQ JS省市区三级联动

    如下图: 首先写一个静态的页面: <!DOCTYPE html> <html> <head> <title>QQ JS省市区三级联动</title ...

  7. 省市区三级联动(二)JS部分简单版

    通过对上一篇<省市区三级联动>的学习发现JScript部分省市区的填充代码几乎相同,所以可以写成一个函数. 注意:html部分和chuli.php部分不变 1.下拉列表填充可以写成带参数的 ...

  8. 从QQ网站中提取的纯JS省市区三级联动

    在 http://ip.qq.com/ 的网站中有QQ自己的JS省市区三级联动 QQ是使用引用外部JS来实现三级联动的.JS如下:http://ip.qq.com/js/geo.js <!DOC ...

  9. 基于ThinkPHP+AJAX的省市区三级联动

    练习,就当练习. 省市区三级联动,样式如下图所示: 1,导入两个js文件并且导入数据库文件. 两个js文件分别是jquery-2.1.4.min.js和jquery-1.js,数据库文件,见附件. 2 ...

随机推荐

  1. 多个string数组组装成一个List<Object>

    最近遇到一个问题,数据库里面的数据存了一个多图字段和一个图片对应的排序,然后输出的时候需要按排序处理下. 当然,最容易想到的办法是遍历,然后添加,这次不想玩这么低级的代码,而且类似的需求项目中有好几个 ...

  2. 【贪心】经营与开发 @upc_exam_5500

    目录 经营与开发 @upc_exam_5500 PROBLEM 题目描述 输入 输出 样例输入 样例输出 提示 SOLUTION CODE 经营与开发 @upc_exam_5500 PROBLEM 题 ...

  3. 【动态规划】Column Addition @ICPC2017Tehran/upcexam5434

    时间限制: 1 Sec 内存限制: 128 MB 题目描述 A multi-digit column addition is a formula on adding two integers writ ...

  4. 记录使用yum安装nginx之后的目录问题

    一般来说我们安装nginx的目录都是/usr/local/nginx的,但是用yum安装的目录跟手动安装的不一样,下面是整理的使用yum安装的一些对应目录. nginx执行文件目录:/usr/sbin ...

  5. redis 简单使用总结

    作者:王清培(Plen wang)  沪江Java资深架构师 最近一段时间与redis接触比较频繁.发现有些东西还是工作中经常会用到的,自己也花了点时间巩固下.本篇文章主要是以总结性的方式梳理,因为r ...

  6. 修改MySql数据库的默认时

    MySql数据库创建后,默认的时区比东八区少了八个小时.如果Sql语句中使用到MySql的时间的话就会比正常时间少了八个小时.所以需要修改MySql的系统时区,使其显示的时间和我们现在的时间一致. 1 ...

  7. 什么?又是404!趣图助你理解HTTP状态码~

    HTTP状态码(一):   注释: 301—永久移动.被请求的资源已被永久移动位置: 302—请求的资源现在临时从不同的 URI 响应请求: 305—使用代理.被请求的资源必须通过指定的代理才能被访问 ...

  8. [Python设计模式] 第27章 正则表达式——解释器模式

    github地址:https://github.com/cheesezh/python_design_patterns 解释器模式 解释器模式,给定一个语言,定一个它的文法的一种表示,并定一个一个解释 ...

  9. 什么是 Spring Boot

    Spring Boot 介绍 Spring Boot 是由 Pivotal 团队提供的全新框架,其设计目的是用来简化新 Spring 应用的初始搭建以及开发过程.该框架使用了特定的方式来进行配置,从而 ...

  10. 【PMP】项目管理ITTO概述

    1.项目整合管理