MOSS关于OM遍历列表所有信息
开发一步一步熟悉MOSS对象模型的操作,我建议做MOSS开发的哥们多多看看WSS3.0的 SDK噢 ,那里有很多你们需要的好东西。。
using System;
using System.Runtime.InteropServices;
using System.Web.UI;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Serialization;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.WebPartPages;
namespace WebPartDemo
{
[Guid("f7145e12-c25e-419f-90bd-ffe928ba084d")]
public class WebPartDemo : System.Web.UI.WebControls.WebParts.WebPart
{
public WebPartDemo()
{
this.ExportMode = WebPartExportMode.All;
}
protected override void Render(HtmlTextWriter writer)
{
//writer.Write("Hello, Web!");
SPWeb web = SPContext.Current.Web;
SPList list = web.Lists["test"];
writer.WriteLine("ID:{0}<br/>", list.ID.ToString("B").ToUpper());
foreach (SPListItem item in list.Items)
writer.WriteLine(item.DisplayName + "<br/>");
}
}
}
高手们,看到了,不要笑我。