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 Returns the context that is associated with the client object. (从 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 Gets the object data for the current client object. (从 ClientObject 继承。)
公共属性 ObjectVersion Gets a string that indicates the version of the current client object. 此成员仅供内部使用,不能直接在您的代码中使用。 (从 ClientObject 继承。)
公共属性 Path Tracks how a client object is created in the ClientRuntimeContext class so that the object can be recreated on the server. 此成员仅供内部使用,不能直接在您的代码中使用。 (从 ClientObject 继承。)
公共属性 Properties
公共属性 ServerObjectIsNull Gets the server object and returns null if the server object is null. (从 ClientObject 继承。)
公共属性 ServerRelativeUrl Gets the relative URL of the file based on the URL for the server.
公共属性 SiteId
公共属性 Tag Gets or sets data that is associated with the client object. (从 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 Gets the object with the correct type information returned from the server. (从 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 Checks to determine whether the specified value type property of a ClientObject has been initialized. (从 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 Returns a Boolean value that indicates whether custom code was used to populate an object. 此成员仅供内部使用,不能直接在您的代码中使用。 (从 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 Indicates whether custom code was used to populate an object. 此成员仅供内部使用,不能直接在您的代码中使用。 (从 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 Initializes a non-property field of the client object based on JavaScript 对象表示法 (JSON) data from the server. 此成员仅供内部使用,不能直接在您的代码中使用。 (从 ClientObject 继承。)
受保护的方法 InitOnePropertyFromJson (覆盖 ClientObject.InitOnePropertyFromJson(String, JsonReader)。)
公共方法 IsObjectPropertyInstantiated Indicates whether the specified property of the client object is instantiated. (从 ClientObject 继承。)
公共方法 IsPropertyAvailable Returns a Boolean value that indicates whether the specified scalar property has been retrieved or set. (从 ClientObject 继承。)
受保护的方法 LoadExpandoFields Initializes the extended properties associated with the client object when overridden in a derived class. (从 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 Reloads all scalar properties associated with the client object when overridden in a derived class. (从 ClientObject 继承。)
受保护的方法 RemoveFromParentCollection Removes the current client object from the parent client object collection. (从 ClientObject 继承。)
公共方法 Retrieve() Retrieves all scalar properties associated with the object. 此成员仅供内部使用,不能直接在您的代码中使用。 (从 ClientObject 继承。)
公共方法 Retrieve([]) Retrieves the specified scalar properties associated with the object. 此成员仅供内部使用,不能直接在您的代码中使用。 (从 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 Updates the client object property's value to have correct type by using the type information returned from the server. (从 ClientObject 继承。)

页首

另请参阅

引用

File 类

Microsoft.SharePoint.Client 命名空间