2011年9月23日 星期五

利用 C# 取得 SharePoint 網站集合的資料

1. 建立一個 C# 應用程式,
    NET Framework要用3.5
    要選擇 Any CPU
    要加入參考「Microsoft.SharePoint」


2. 輸入以下的程式碼

string targetSiteUrl = "";
using (SPSite siteCollection = new SPSite(targetSiteUrl))
{
SPWeb site = siteCollection.RootWeb;
MessageBox.Show(site.Title);

}




沒有留言:

張貼留言