File.MoveTo 方法
將檔案移至指定的目的地 URL。
命名空間: Microsoft.SharePoint.Client
組件: Microsoft.SharePoint.Client.Silverlight (在 Microsoft.SharePoint.Client.Silverlight.dll 中); Microsoft.SharePoint.Client.Phone (在 Microsoft.SharePoint.Client.Phone.dll 中) Microsoft.SharePoint.Client (在 Microsoft.SharePoint.Client.dll 中)
語法
'宣告
Public Sub MoveTo ( _
newUrl As String, _
flags As MoveOperations _
)
'用途
Dim instance As File
Dim newUrl As String
Dim flags As MoveOperations
instance.MoveTo(newUrl, flags)
public void MoveTo(
string newUrl,
MoveOperations flags
)
參數
newUrl
類型:System.String指定的目的地 URL。
它不能null 參考 (未執行任何動作 於 Visual Basic 中)。它必須相對或絕對表單的 URL。
flags
類型:Microsoft.SharePoint.Client.MoveOperations指定移動作業的類型。
不能 MoveOperations.Overwrite 或 MoveOperations.AllowBrokenThickets 設定以外的標幟。
例外狀況
例外狀況 | 條件 |
---|---|
[Microsoft.SharePoint.SPDuplicateValuesFoundException] | 無法更新清單項目。找不到清單中的一或多個欄位的重複值。錯誤碼 ︰-2130575169。 |
[Microsoft.SharePoint.SPFileCheckOutException] | 未取出檔案。錯誤碼 ︰-2147024738。 |
[Microsoft.SharePoint.SPFileCheckOutException] | 目前的使用者以外的使用者已取出檔案。錯誤碼 ︰-2130575306。 |
[Microsoft.SharePoint.SPFileLockException] | 未鎖定檔案。錯誤碼 ︰-2147024729。 |
[Microsoft.SharePoint.SPFileLockException] | 作業逾時。錯誤碼 ︰-2147023436。 |
[Microsoft.SharePoint.SPFileLockException] | 共用檔案鎖定。錯誤碼 ︰-2147018894。 |
[Microsoft.SharePoint.SPFileLockException] | 獨佔鎖定檔案。錯誤碼 ︰-2147018887。 |
[Microsoft.SharePoint.SPInvalidLookupValuesException] | 無法更新清單項目。找不到一或多個欄位清單中的無效查閱值。錯誤碼 ︰-2130575159。 |
[System.ArgumentException] | URL 必須參照至目前的網站集合中的位置。錯誤碼 ︰-2147024809。 |
[System.UnauthorizedAccessException] | 目前的使用者會有足夠的權限。錯誤碼 ︰-2147024891。 |