Private void button#click (Object sender, eventargs e) {string weburl = "http: // richsharepoint: 90/applicationmanagement"; spsecurity. runwithelevatedprivileges (delegate () {using (spsite site = new spsite (weburl) {using (spweb = site. openweb ("applicationmanagement") {splistcollection lists = web. lists; splist list = NULL; For (INT I = 0; I <lists. count; I ++) {list = lists [I]; If (isneedlist (list. title) {extendfolderperproty (Web, list) ;}}}});} private bool isneedlist (string listname) {string [] listnames = new string [] {"picturelibraryanson"}; For (INT I = 0; I <listnames. length; I ++) {If (listnames [I]. tostring () = listname) {return true ;}} return false;} private void extendfolderperproty (spweb, splist list) {spcontenttype Ct = List. contenttypes ["folder"]; Ct. sealed = false; // remove the properties CT. fieldlinks. delete ("numbercolumn"); Ct. fieldlinks. delete ("direct_x0020_link"); Ct. fieldlinks. delete ("media_x0020_category"); Ct. fieldlinks. delete ("market_x0020_category"); Ct. update (); // web. fields. add ("numbercolumn", spfieldtype. number, false); // spfieldlink flink1 = new spfieldlink (web. fields ["numbercolumn"]); // CT. fieldlinks. add (flink1); // Add direct link column string hcolumnname = "direct link"; web. fields. add (hcolumnname, spfieldtype. URL, false); spfieldlink HLINK = new spfieldlink (web. fields [hcolumnname]); Ct. fieldlinks. add (hlink); // Add media Category column mediachoicecolumn (Web, CT); Ct. update ();} private void mediachoicecolumn (spweb, spcontenttype CT) {string columnname = "media category"; web. fields. add (columnname, spfieldtype. choice, false); spfieldchoice choicefield = (spfieldchoice) web. fields [columnname]; // Add a group to the filed // choicefield. group = "mygroup"; // Add choices string [] choiceitems = new string [] {"Bulletin", "Junior poster", "poster", "spectacular ", "wall", "wrapped building/poster", "mobile billboard", "Airport Media", "Bus Media", "rail/subway Media", "Taxi Media ", "mall Media", "sports media (ARENA/Stadium)", "Street Furniture", "place-based media (not digital)", "alternative/promotional media ", "Guerilla Media", "street teams", "experiential/event", "digital billboard", "Digital spectacular", "Digital poster", "digital street furniture ", "Digital airport Media", "Digital transit Media", "digital mobile media", "Digital taxi Media", "digital projection Media", "Digital place based-Medical & Fitness ", "Digital place based-Education & office", "Digital place based-Leisure", "Digital place based-retail", "Digital alternative media", "mobile media "}; for (Int J = 0; j <choiceitems. length; j ++) {// Add choice choicefield. choices. add (choiceitems [J]. tostring ();} choicefield. editformat = spchoiceformattype. dropdown; // set the default choice choicefield. defaultvalue = "Bulletin"; choicefield. update (); spfieldlink FL = new spfieldlink (choicefield); Ct. fieldlinks. add (FL);} // Delete list folder content type private void button2_click (Object sender, eventargs e) {string weburl = "http: // shengvm77: 84 "; try {spsecurity. runwithelevatedprivileges (delegate () {using (spsite site = new spsite (weburl) {using (spweb = site. openweb ("homeanson") {splistcollection lists = web. lists; splist list = NULL; For (INT I = 0; I <lists. count; I ++) {list = lists [I]; If (list. title = "picanson") {spcontenttype Ct = List. contenttypes ["folder"]; List. contenttypes. delete (Ct. ID); list. update (); break ;}}}});} catch (exception ex) {MessageBox. show (ex. message );}}