private string List(string pid = null) { QueryParam query = new QueryParam(); query.Add(new NameValuePair <object>("pid", pid)); var dt = this.DataService.GetExecuteCmd("List").AsBuilder(this.Buider, query).GetDataTable(); StringBuilder sb = new StringBuilder(); //sb.Append("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"); sb.Append("<root>"); foreach (DataRow dr in dt.Rows) { sb.AppendFormat("<ds text=\"{0}\" PID=\"{1}\" ", dr["ds_name"], dr["pid"]); if (dr["ds_isfolder"].TryParseToString() == "1") {//目录 sb.AppendFormat(" lazyLoad=\"{0}?pid={1}\"", DataCenter_FullPath, dr["id"]); } else { sb.AppendFormat(" id=\"{0}\" descURL=\"{1}/desc/{2}\" dataURL=\"{1}/data/{2}\"", dr["id"], DataCenter_FullPath, dr["dsc_id"]); } sb.Append("/>"); } sb.Append("</root>"); return(sb.ToString()); }