共用方式為


SPListItemCollection.Add method (String, SPFileSystemObjectType, String)

建立使用指定的資料夾 URL、 物件類型和分葉名稱,但需要SPListItem.Update方法,以實際將項目加入清單中的項目。

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'宣告
Public Function Add ( _
    folderUrl As String, _
    underlyingObjectType As SPFileSystemObjectType, _
    leafName As String _
) As SPListItem
'用途
Dim instance As SPListItemCollection
Dim folderUrl As String
Dim underlyingObjectType As SPFileSystemObjectType
Dim leafName As String
Dim returnValue As SPListItem

returnValue = instance.Add(folderUrl, _
    underlyingObjectType, leafName)
public SPListItem Add(
    string folderUrl,
    SPFileSystemObjectType underlyingObjectType,
    string leafName
)

參數

  • folderUrl
    Type: System.String

    伺服器相對 URL 的資料夾,開始以正斜線。例如, /sites/mysite/subweb/Lists/mylist/myfolder。

  • leafName
    Type: System.String

    檔案名稱,包括副檔名。例如, mydoc.doc。如需詳細資訊,請參閱Name屬性。

傳回值

Type: Microsoft.SharePoint.SPListItem
新的項目。

請參閱

參照

SPListItemCollection class

SPListItemCollection members

Add overload

Microsoft.SharePoint namespace