SPFileCollection.Add method (String, Stream, Boolean)
使用指定的 URL、 資料流,包含檔案的內容和布林值,指定是否要覆寫任何檔案,具有相同名稱的集合中建立的檔案。
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
Public Function Add ( _
urlOfFile As String, _
file As Stream, _
overwrite As Boolean _
) As SPFile
'用途
Dim instance As SPFileCollection
Dim urlOfFile As String
Dim file As Stream
Dim overwrite As Boolean
Dim returnValue As SPFile
returnValue = instance.Add(urlOfFile, _
file, overwrite)
public SPFile Add(
string urlOfFile,
Stream file,
bool overwrite
)
參數
urlOfFile
Type: System.String檔案的站台相對 URL。
file
Type: System.IO.Stream包含檔案的資料流。
overwrite
Type: System.Boolean若要覆寫相同的名稱,檔案的true 否則, false。
傳回值
Type: Microsoft.SharePoint.SPFile
新加入的檔案。