SPSite site = new SPSite("http://spvm"); SPWeb web = site.RootWeb; web.AllowUnsafeUpdates = true;//设置允许更改 SPList list=web.Lists["Tasks"];//实例化列表名称 for (int i = 0; i < list.Items.Count; i++) { Response.Write(list.Items[i].Title); Response.Write("<br/>"); } SPListItem item = list.Items.Add(); item["Title"] = "Call Tom";//向列表添加为Call Tom item.Update();//更新 web.Dispose(); site.Dispose();