共用方式為


SPFileCollection.Add method (String, Byte[], Boolean, String, Boolean)

使用指定的 URL、 位元組陣列,包含檔案的內容、 布林值,指定是否要覆寫具有相同的名稱、 簽入註解和布林值,指定是否要檢查必要的欄位的任何檔案集合中建立的檔案。

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

Syntax

'宣告
Public Function Add ( _
    urlOfFile As String, _
    file As Byte(), _
    overwrite As Boolean, _
    checkInComment As String, _
    checkRequiredFields As Boolean _
) As SPFile
'用途
Dim instance As SPFileCollection
Dim urlOfFile As String
Dim file As Byte()
Dim overwrite As Boolean
Dim checkInComment As String
Dim checkRequiredFields As Boolean
Dim returnValue As SPFile

returnValue = instance.Add(urlOfFile, _
    file, overwrite, checkInComment, _
    checkRequiredFields)
public SPFile Add(
    string urlOfFile,
    byte[] file,
    bool overwrite,
    string checkInComment,
    bool checkRequiredFields
)

參數

  • file
    Type: []

    位元組陣列,包含檔案。

  • overwrite
    Type: System.Boolean

    若要覆寫相同的名稱,檔案的true否則, false。

  • checkInComment
    Type: System.String

    若要在集合中建立檔案時,使用註解的文字。

  • checkRequiredFields
    Type: System.Boolean

    true來檢查必要的欄位,當儲存檔案。否則, false。

傳回值

Type: Microsoft.SharePoint.SPFile
新加入的檔案。

請參閱

參照

SPFileCollection class

SPFileCollection members

Add overload

Microsoft.SharePoint namespace