by1455的自留地

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

          

          Dim spsite As New SPSite(ServerURL)
          Dim spweb As SPWeb = spsite.OpenWeb()
          Dim splist As SPList = spweb.Lists(ListName)
          Dim MD5String As String = String.Empty
          Dim foldername as string = "Category11"
        
           spweb.AllowUnsafeUpdates = True
           Dim Spitemfolders As SPListItemCollection = splist.Folders
           Dim SPitemfolder As SPListItem
           Dim isFolderNoExist As Boolean = True


             For Each SPitemfolder In Spitemfolders
                 If SPitemfolder.Name = Foldername Then
                     isFolderNoExist = False
                 End If
             Next


             If isFolderNoExist Then
                 Dim newFolder As SPListItem = splist.Items.Add(splist.RootFolder.ServerRelativeUrl, PFileSystemObjectType.Folder, "")
                 newFolder("Name") = foldername
                 newFolder.Update()
              endif

posted on 2008-09-23 15:29  by1455  阅读(313)  评论(0编辑  收藏  举报