File Object (VB6)

Description

The File object represents a disk file that can be a file of any type and allows you to interrogate the properties of the file and to move upward in the file system hierarchy to interrogate the system on which the file resides. The process of creating a File object—for example, assigning a reference from the Files object's Item property to a local object variable—doesn't open the file.

The File object is part of the File System object model; for an overview of the model, including the library reference needed to access it, see the File System object model entry.

Createable

No

Returned by

Files.Item property

Properties


Attributes

Data Type: FileAttribute constant

See the "FileAttribute Constants" table in the Folder Object entry.


DateCreated

Data Type: Date

The date the file was created.


DateLastAccessed

Data Type: Date

If available from the operating system, the date the file was last accessed.


DateLastModified

Data Type: Date

The date the file was last modified.


Drive

Data Type: Drive object

Returns a Drive object representing the drive on which the file resides.


Name

Data Type: String

The name of the file.


ParentFolder

Data Type: Folder object

Returns a Folder object representing the folder in which the file resides.


Path

Data Type: String

Returns the full path to the file from the current machine, including drive letter or network path/share name.


ShortName

Data Type: String

Returns a DOS 8.3 filename; may not work on an NTFS system.


ShortPath

Data Type: String

Returns a DOS 8.3 folder name; may not work on an NTFS system.


Size

Data Type: Variant

Returns the size of the file in bytes.


Type

Data Type: String

Returns a string containing the registered type description. This is the type string displayed for the file in the Windows Explorer. If a file doesn't have an extension, the type is simply "File." When a file's type isn't registered, the type appears as the extension and "File."

Methods

Copy Move
Delete OpenAsTextStream

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.86.224