/// <summary> /// 遍历所有的父节点下的 父节点名 加_序号(从0开始) 名称的key /// </summary> /// <param name="section">节点名</param> /// <param name="getKeyAction">找到key之后做的事</param> /// <returns>节点下 按规则的节点集合</returns> public static string[] ReadINI(string section, Action <string> getKeyAction = null) { try { List <string> sList = new List <string>(); while (true) { sList.Add(INI.ReadINI(section, section + "_" + sList.Count)); if (string.IsNullOrEmpty(sList.Last())) { break; } else if (getKeyAction != null) { getKeyAction(sList.Last()); } } return(sList.ToArray()); } catch (Exception e) { return(null); } }