1 public static string GetJsonFormSplistItem(SPListItem item, string[] strArr) 2 { 3 string json = "{"; 4 for (int i = 0; i < item.ParentList.Fields.Count - 1; i++) 5 { 6 string fieldName = item.ParentList.Fields[i].InternalName; 7 ArrayList ar = new ArrayList();//实例化一个ArrayList 8 ar.AddRange(strArr);//把数组赋到Arraylist对象 9 if (ar.Contains(fieldName))10 {11 if (item[i] != null)12 {13 json += "/"" + fieldName + "/":/"" + item[i].ToString() + "/",";14 }15 else16 {17 json += "/"" + fieldName + "/":/"/",";18 }19 20 }21 }22 json += "},";23 return json;24 }25 26 public string[] PRoblemRiskArr = { "ProjectName", "ProblemBody", "AffectDegree", "User", "CountermoveBody", "Status" };
新闻热点
疑难解答