承接MOSS各种工作流开发 联系人:王先生.电话:18618405729QQ:252385878 QQ群:41696750 MSN:wanghao-3@hotmail.com

导航

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/>");
        }
    }
}
高手们,看到了,不要笑我。

posted on 2007-06-15 10:05  A A  阅读(1551)  评论(2编辑  收藏  举报