首页 新闻 会员 周边 捐助

用SharePoint sdk在一个文档库中新建文件夹报错!

0
悬赏园豆: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>&nbsp; &nbsp; web.AllowUnsafeUpdates = true; <BR>&nbsp; &nbsp; SPListCollection lists = web.GetListsOfType(SPBaseType.DocumentLibrary); <BR>&nbsp; &nbsp; lists.IncludeRootFolder = true; <BR>&nbsp; &nbsp; SPList docsList = lists["行政管理"]; <BR><BR>&nbsp; &nbsp; string rootFolderUrl = docsList.RootFolder.ServerRelativeUrl; <BR>&nbsp; &nbsp; SPListItem folder1 = docsList.Items.Add(rootFolderUrl, SPFileSystemObjectType.Folder, null); <BR>&nbsp; &nbsp; folder1["Title"] = "规章制度"; <BR>&nbsp; &nbsp; folder1["_ModerationStatus"]=0; <BR>&nbsp; &nbsp; folder1.Update();&nbsp; <BR>} </P>
Young.Jiang的主页 Young.Jiang | 初学一级 | 园豆:140
提问于:2008-04-30 10:28
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册