Поделиться через


Элементы File

Represents a file in a SharePoint Web site that can be a Web Part Page, an item in a document library, or a file in a folder.

Тип File предоставляет следующие элементы.

Конструкторы

  Имя Описание
Общий метод File Initializes a new instance of the File object.

Вверх

Свойства

  Имя Описание
Общее свойство Author Gets a value that specifies the user who added the file.
Общее свойство CheckedOutByUser Gets a value that returns the user who has checked out the file.
Общее свойство CheckInComment Gets a value that returns the comment used when a document is checked into a document library.
Общее свойство CheckOutType Gets a value that specifies the type of check out associated with the file.
Общее свойство ContentTag Returns internal version of content, used to validate document equality for read purposes.
Общее свойство Context Возвращает контекст, связанное с клиентского объекта. (Унаследовано от ClientObject.)
Общее свойство CustomizedPageStatus Gets a value that specifies the customization status of the file.
Общее свойство EffectiveInformationRightsManagementSettings
Общее свойство ETag Gets a value that specifies the ETag value.
Общее свойство Exists Gets a value that specifies whether the file exists.
Общее свойство InformationRightsManagementSettings
Общее свойство IrmEnabled
Общее свойство Length Gets the size of the file in bytes, excluding the size of any Web Parts that are used in the file.
Общее свойство Level Gets a value that specifies the publishing level of the file.
Общее свойство LinkingUrl
Общее свойство ListId
Общее свойство ListItemAllFields Gets a value that specifies the list item field values for the list item corresponding to the file.
Общее свойство LockedByUser Gets a value that returns the user that owns the current lock on the file.
Общее свойство MajorVersion Gets a value that specifies the major version of the file.
Общее свойство MinorVersion Gets a value that specifies the minor version of the file.
Общее свойство ModifiedBy Gets a value that returns the user who last modified the file.
Общее свойство Name Gets the name of the file including the extension.
Защищенное свойство ObjectData Для текущего объекта клиент получает данные объекта. (Унаследовано от ClientObject.)
Общее свойство ObjectVersion Возвращает строку, которая показывает версия объекта клиента. Этот элемент зарезервирован для внутреннего использования и не предназначен для прямого применения в коде. (Унаследовано от ClientObject.)
Общее свойство Path Отслеживает как объект клиента при их создании в классе ClientRuntimeContext таким образом, чтобы объект можно воссоздать на сервере. Этот элемент зарезервирован для внутреннего использования и не предназначен для прямого применения в коде. (Унаследовано от ClientObject.)
Общее свойство Properties
Общее свойство ServerObjectIsNull Возвращает серверный объект и возвращает значение null, если объект сервера равно null. (Унаследовано от ClientObject.)
Общее свойство ServerRelativeUrl Gets the relative URL of the file based on the URL for the server.
Общее свойство SiteId
Общее свойство Tag Возвращает или задает данные, связанные с объектом клиента. (Унаследовано от ClientObject.)
Общее свойство TimeCreated Gets a value that specifies when the file was created.
Общее свойство TimeLastModified Gets a value that specifies when the file was last modified.
Общее свойство Title Gets a value that specifies the display name of the file.
Общее свойство TypedObject Возвращает объект с правильный тип сведений, возвращенных на сервере. (Унаследовано от ClientObject.)
Общее свойство UIVersion Gets a value that specifies the implementation-specific version identifier of the file.
Общее свойство UIVersionLabel Gets a value that specifies the implementation-specific version identifier of the file.
Общее свойство UniqueId
Общее свойство VersionEvents
Общее свойство Versions Gets a value that returns a collection of file version objects that represent the versions of the file.
Общее свойство WebId

Вверх

Методы

  Имя Описание
Общий метод Approve Approves the file submitted for content approval with the specified comment.
Общий метод CancelUpload Stops the chunk upload session without saving the uploaded data. If the file doesn’t already exist in the library, the partially updated file will be deleted. Use this in response to user action (as in a request to cancel an upload) or an error or exception.
Общий метод CheckIn Checks the file in to a document library based on the check-in type.
Общий метод CheckOut Checks out the file from a document library based on the check out type.
Защищенный метод CheckUninitializedProperty Проверяет, ли свойство заданное значение type ClientObject инициировано. (Унаследовано от ClientObject.)
Общий метод ContinueUpload Continues the chunk upload session with an additional fragment. The current file content is not changed.
Общий метод CopyTo Copies the file to the destination URL. Server must overwrite an existing file of the same name if bOverwrite is true.
Общий метод CustomFromJson Возвращает значение типа Boolean, указывающее использовалось ли пользовательского кода для заполнения объекта. Этот элемент зарезервирован для внутреннего использования и не предназначен для прямого применения в коде. (Унаследовано от ClientObject.)
Общий метод DeleteObject Deletes the file object.
Общий метод Deny Denies approval for a file that was submitted for content approval.
Общий метод ExecuteCobaltRequest
Общий метод FinishUpload Uploads the last file fragment and commits the file. The current file content is changed when this method completes.
Общий метод FromJson Указывает, использовалось ли пользовательского кода для заполнения объекта. Этот элемент зарезервирован для внутреннего использования и не предназначен для прямого применения в коде. (Унаследовано от ClientObject.)
Общий методСтатический элемент GetContentVerFromTag Reserved for internal use only. This method exposes the internal ContentVersion value inside of a ContentTag.
Общий метод GetImagePreviewUrl
Общий метод GetLimitedWebPartManager Specifies the control set used to access, modify, or add Web Parts associated with this Web Part Page and view.
Общий метод GetPreAuthorizedAccessUrl
Общий метод GetWOPIFrameUrl
Защищенный метод InitNonPropertyFieldFromJson Выполняет инициализацию поля не свойства объекта клиента, на основе данных Нотация объектов JavaScript (JSON) с сервера. Этот элемент зарезервирован для внутреннего использования и не предназначен для прямого применения в коде. (Унаследовано от ClientObject.)
Защищенный метод InitOnePropertyFromJson (Переопределяет ClientObject.InitOnePropertyFromJson(String, JsonReader).)
Общий метод IsObjectPropertyInstantiated Указывает, создается ли свойство указанного объекта клиента. (Унаследовано от ClientObject.)
Общий метод IsPropertyAvailable Возвращает значение типа Boolean, указывающее, имеет ли свойство скалярное получить или задать. (Унаследовано от ClientObject.)
Защищенный метод LoadExpandoFields Выполняет инициализацию расширенные свойства, связанные с объектом клиент переопределение производных классов. (Унаследовано от ClientObject.)
Общий метод MoveTo Moves the file to the specified destination URL.
Общий методСтатический элемент OpenBinaryDirect(ClientContext, String) Downloads the specified file from a SharePoint site without requiring an ExecuteQuery() method call.
Общий методСтатический элемент OpenBinaryDirect(ClientContext, String, EventHandler<OpenBinarySucceededEventArgs>, EventHandler<OpenBinaryFailedEventArgs>)
Общий метод OpenBinaryStream Opens the file as a stream.
Общий метод Publish Submits the file for content approval with the specified comment.
Общий метод Recycle Moves the file to the Recycle Bin and returns the identifier of the new Recycle Bin item.
Общий метод RefreshLoad Перезагрузка все скалярные свойствах, связанных с клиентского объекта переопределение производных классов. (Унаследовано от ClientObject.)
Защищенный метод RemoveFromParentCollection Удаляет текущий объект клиента из коллекции родительского объекта клиента. (Унаследовано от ClientObject.)
Общий метод Retrieve() Извлекает все скалярные свойства, связанные с объектом. Этот элемент зарезервирован для внутреннего использования и не предназначен для прямого применения в коде. (Унаследовано от ClientObject.)
Общий метод Retrieve([]) Возвращает указанное скалярное свойствах, связанных с объектом. Этот элемент зарезервирован для внутреннего использования и не предназначен для прямого применения в коде. (Унаследовано от ClientObject.)
Общий метод SaveBinary Saves the specified file into a document library.
Общий методСтатический элемент SaveBinaryDirect(ClientContext, String, Stream, Boolean) Uploads the specified file to a SharePoint site without requiring an ExecuteQuery() method call.
Общий методСтатический элемент SaveBinaryDirect(ClientContext, String, Stream, String) Uploads the specified file to a SharePoint site with the specified Etag without requiring an ExecuteQuery() method call.
Общий метод StartUpload Starts a new chunk upload session and uploads the first fragment. The current file content is not changed when this method completes. The method is idempotent (and therefore does not change the result) as long as you use the same values for uploadId and stream.The upload session ends either when you use the CancelUpload(Guid) method or when you successfully complete the upload session by passing the rest of the file contents through the ContinueUpload(Guid, Int64, Stream) and FinishUpload(Guid, Int64, Stream) methods.For example, you can pass a 35 MB file by dividing it into three 10 MB streams and one 5 MB stream and uploading them this way (using the resulting offset values of 10, 20 and 30 MB):StartUpload(GUID, stream1)
ContinueUpload(GUID, 10 MB, stream2)
ContinueUpload(GUID, 20 MB, stream3)
FinishUpload(GUID, 30 MB, stream4)The StartUpload(Guid, Stream) and ContinueUpload(Guid, Int64, Stream) methods return the size of the running total of uploaded data in bytes, so you can pass those return values to subsequent uses of ContinueUpload(Guid, Int64, Stream) and FinishUpload(Guid, Int64, Stream)
Общий метод ToString (Унаследовано от Object.)
Общий метод UndoCheckOut Reverts an existing checkout for the file.
Общий метод UnPublish Removes the file from content approval or unpublish a major version.
Общий метод Update
Защищенный метод UpdateClientObjectPropertyType Обновляет свойства объекта клиента значение должно иметь правильный тип с помощью тип сведений, возвращенных на сервере. (Унаследовано от ClientObject.)

Вверх

См. также

Справочные материалы

File класс

Пространство имен Microsoft.SharePoint.Client