[]
        
(Showing Draft Content)

GrapeCity.Documents.DX.Storage.NativeFile

Class NativeFile

Namespace
GrapeCity.Documents.DX.Storage
Assembly
GcDocs.DX.Windows.dll

Windows File Helper.

public static class NativeFile
Inheritance
object
NativeFile
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

Methods

Exists(string)

Checks if the specified file path exists.

public static bool Exists(string filePath)

Parameters

filePath string

The file path.

Returns

bool

true if the specified file path exists, false otherwise

GetLastWriteTime(string)

Gets the last write time access for the specified path.

public static DateTime GetLastWriteTime(string path)

Parameters

path string

The path.

Returns

System.DateTime

The last write time access

ReadAllBytes(string)

Opens a binary file, reads the contents of the file into a byte array, and then closes the file.

public static byte[] ReadAllBytes(string path)

Parameters

path string

The file to open for reading.

Returns

byte[]

A byte array containing the contents of the file.

ReadAllText(string, Encoding, NativeFileShare)

Opens a text file, reads all lines of the file, and then closes the file.

public static string ReadAllText(string path, Encoding encoding, NativeFileShare sharing = NativeFileShare.Read)

Parameters

path string

The file to open for reading.

encoding System.Text.Encoding

The encoding.

sharing NativeFileShare

The sharing.

Returns

string

A string containing all lines of the file.

ReadAllText(string)

Opens a text file, reads all lines of the file, and then closes the file.

public static string ReadAllText(string path)

Parameters

path string

The file to open for reading.

Returns

string

A string containing all lines of the file.