悬赏园豆:20
[已关闭问题]
<P>在利用sps的sdk进行开发是,我想在一个文档库中新建一个文件夹,但报错:Microsoft.SharePoint.SPException: 无效项目数据 -- 缺少 FileRef <BR>请高手帮我看看下面代码有什么问题!! <BR></P>
<P>SPSite siteList = new SPSite(sps_host); <BR>using (SPWeb web = siteList.OpenWeb()) <BR>{ <BR> web.AllowUnsafeUpdates = true; <BR> SPListCollection lists = web.GetListsOfType(SPBaseType.DocumentLibrary); <BR> lists.IncludeRootFolder = true; <BR> SPList docsList = lists["行政管理"]; <BR><BR> string rootFolderUrl = docsList.RootFolder.ServerRelativeUrl; <BR> SPListItem folder1 = docsList.Items.Add(rootFolderUrl, SPFileSystemObjectType.Folder, null); <BR> folder1["Title"] = "规章制度"; <BR> folder1["_ModerationStatus"]=0; <BR> folder1.Update(); <BR>} </P>