SPListItemCollection.Add 方法 (String, SPFileSystemObjectType)
Creates an item that uses the specified folder URL and object type but requires the SPListItem.Update method to actually add the item to the list.
命名空间: Microsoft.SharePoint
程序集: Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)
语法
声明
Public Function Add ( _
folderUrl As String, _
underlyingObjectType As SPFileSystemObjectType _
) As SPListItem
用法
Dim instance As SPListItemCollection
Dim folderUrl As String
Dim underlyingObjectType As SPFileSystemObjectType
Dim returnValue As SPListItem
returnValue = instance.Add(folderUrl, _
underlyingObjectType)
public SPListItem Add(
string folderUrl,
SPFileSystemObjectType underlyingObjectType
)
参数
folderUrl
类型:System.StringThe server-relative URL of the folder where the list item should be created. The URL should begin with a forward slash; for example, /sites/mysite/subweb/Lists/mylist/myfolder.
underlyingObjectType
类型:Microsoft.SharePoint.SPFileSystemObjectTypeOne of the enumeration values that specifies the type of file system object that the new list item will represent. The only valid types are File and Folder. If you pass another value, an exception is thrown when you call the Update method on the SPListItem object.
返回值
类型:Microsoft.SharePoint.SPListItem
The new item.