SPFileVersionCollection.Restore method
還原檔案版本物件在集合中指定之索引處。
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
Public Sub Restore ( _
iIndex As Integer _
)
'用途
Dim instance As SPFileVersionCollection
Dim iIndex As Integer
instance.Restore(iIndex)
public void Restore(
int iIndex
)
參數
iIndex
Type: System.Int32若要還原的版本的索引。
備註
如果文件庫已啟用版本控制檔案未簽出,目前的檔案還原版本時,就會成為最新版本。
使用Restore方法是使用OpenBinary類別的方法SPFileVersion和SPFile類別,如myVersion.File.SaveBinary(myVersions[5].OpenBinary)的SaveBinary方法的組合一樣。不過, Restore方法會更有效率。