public static class QuickIOFile
Provides static methods to access files. For example creating, deleting and retrieving content and security information such as the owner.
AddAttribute(QuickIOFileInfo info, FileAttributes attribute)
Adds the specified attribute to file or directory
public static Boolean AddAttribute(QuickIOFileInfo info, FileAttributes attribute)
Parameters
info
QuickIOFileInfoA directory or file.
attribute
FileAttributesAttribute to add
Returns
true if added. false if already exists in attributes
AddAttribute(QuickIOPathInfo info, FileAttributes attribute)
Adds the specified attribute to file or directory
public static Boolean AddAttribute(QuickIOPathInfo info, FileAttributes attribute)
Parameters
info
QuickIOPathInfoA directory or file.
attribute
FileAttributesAttribute to add
Returns
true if added. false if already exists in attributes
AddAttribute(String path, FileAttributes attribute)
Adds the specified attribute to file or directory
public static Boolean AddAttribute(String path, FileAttributes attribute)
Parameters
path
StringA directory or file.
attribute
FileAttributesAttribute to add
Returns
true if added. false if already exists in attributes
AppendAllLines(QuickIOPathInfo pathInfo, IEnumerable contents)
Appends lines to a file. If the file does not exist, it creates the file. Uses UTF-8 Encoding.
public static void AppendAllLines(QuickIOPathInfo pathInfo, IEnumerable contents)
Parameters
pathInfo
QuickIOPathInfoThe file to append the lines to. The file is created if it doesn't exist.
contents
IEnumerableThe lines to append.
Remarks
http://msdn.microsoft.com/en-us/library/dd383691(v=vs.110).aspx
AppendAllLines(QuickIOPathInfo pathInfo, IEnumerable contents, Encoding encoding)
Appends lines by using the specified encoding. If the file does not exist, it creates the file.
public static void AppendAllLines(QuickIOPathInfo pathInfo, IEnumerable contents, Encoding encoding)
Parameters
pathInfo
QuickIOPathInfoThe file to append the lines to. The file is created if it doesn't exist.
contents
IEnumerableThe lines to append.
encoding
EncodingThe character encoding.
Remarks
http://msdn.microsoft.com/en-us/library/dd383356(v=vs.110).aspx
AppendAllLines(String path, IEnumerable contents)
Appends lines to a file. If the file does not exist, it creates the file. Uses UTF-8 Encoding.
public static void AppendAllLines(String path, IEnumerable contents)
Parameters
path
StringThe file to append the lines to. The file is created if it doesn't exist.
contents
IEnumerableThe lines to append.
Remarks
http://msdn.microsoft.com/en-us/library/dd383691(v=vs.110).aspx
AppendAllLines(String path, IEnumerable contents, Encoding encoding)
Appends lines by using the specified encoding. If the file does not exist, it creates the file.
public static void AppendAllLines(String path, IEnumerable contents, Encoding encoding)
Parameters
path
StringThe file to append the lines to. The file is created if it doesn't exist.
contents
IEnumerableThe lines to append.
encoding
EncodingThe character encoding.
Remarks
http://msdn.microsoft.com/en-us/library/dd383356(v=vs.110).aspx
AppendAllText(QuickIOPathInfo pathInfo, String contents)
Appends the specified string. If the file does not exist, it creates the file. Uses UTF-8 Encoding.
public static void AppendAllText(QuickIOPathInfo pathInfo, String contents)
Parameters
pathInfo
QuickIOPathInfoThe file to append the specified string to.
contents
StringThe string to append to the file.
Remarks
http://msdn.microsoft.com/en-us/library/ms143356(v=vs.110).aspx
AppendAllText(QuickIOPathInfo pathInfo, String contents, Encoding encoding)
Appends the specified string. If the file does not exist, it creates the file.
public static void AppendAllText(QuickIOPathInfo pathInfo, String contents, Encoding encoding)
Parameters
pathInfo
QuickIOPathInfoThe file to append the specified string to.
contents
StringThe string to append to the file.
encoding
EncodingThe character encoding.
Remarks
http://msdn.microsoft.com/en-us/library/ms143356(v=vs.110).aspx
AppendAllText(String path, String contents)
Appends the specified string. If the file does not exist, it creates the file. Uses UTF-8 Encoding.
public static void AppendAllText(String path, String contents)
Parameters
path
StringThe file to append the specified string to.
contents
StringThe string to append to the file.
Remarks
http://msdn.microsoft.com/en-us/library/ms143356(v=vs.110).aspx
AppendAllText(String path, String contents, Encoding encoding)
Appends the specified string. If the file does not exist, it creates the file.
public static void AppendAllText(String path, String contents, Encoding encoding)
Parameters
path
StringThe file to append the specified string to.
contents
StringThe string to append to the file.
encoding
EncodingThe character encoding.
Remarks
http://msdn.microsoft.com/en-us/library/ms143356(v=vs.110).aspx
CalculateHash(QuickIOPathInfo pathInfo, QuickIOHashImplementationType hashImplementationType)
File content hash calculation
public static QuickIOHashResult CalculateHash(QuickIOPathInfo pathInfo, QuickIOHashImplementationType hashImplementationType)
CalculateHash(HashAlgorithm hashAlgorithm, Stream stream)
File content hash calculation
public static QuickIOHashResult CalculateHash(HashAlgorithm hashAlgorithm, Stream stream)
Returns
QuickIOHashResult
Example
// Implementation of
public static QuickIOHashResult CalculateSha256Hash( QuickIOPathInfo pathInfo )
{
using ( var fs = OpenRead( pathInfo ) )
using ( var hashAlgorithm = SHA256.Create( ) )
{
return CalculateHash( hashAlgorithm, fs );
}
}
CalculateMD5Hash(QuickIOPathInfo pathInfo)
File content hash calculation using MD5
public static QuickIOHashResult CalculateMD5Hash(QuickIOPathInfo pathInfo)
Returns
QuickIOHashResult
Example
// Show human readable hash
QuickIOHashResult hashResult = QuickIOFile.CalculateMD5Hash( "C:\temp\image.bin" );
Console.WriteLine("Hash: {0}", hashResult.Format( Encoding.UTF8, "x2" );
CalculateSha1Hash(QuickIOPathInfo pathInfo)
File content hash calculation using SHA1
public static QuickIOHashResult CalculateSha1Hash(QuickIOPathInfo pathInfo)
Returns
QuickIOHashResult
Example
// Show human readable hash
QuickIOHashResult hashResult = QuickIOFile.CalculateSha1Hash( "C:\temp\image.bin" );
Console.WriteLine("Hash: {0}", hashResult.Format( Encoding.UTF8, "x2" );
CalculateSha256Hash(QuickIOPathInfo pathInfo)
File content hash calculation using SHA256
public static QuickIOHashResult CalculateSha256Hash(QuickIOPathInfo pathInfo)
Returns
QuickIOHashResult
Remarks
Not compatible with FIPShttp://msdn.microsoft.com/de-de/library/hydyw22a(v=vs.110).aspx
Example
// Show human readable hash
QuickIOHashResult hashResult = QuickIOFile.CalculateSha256Hash( "C:\temp\image.bin" );
Console.WriteLine("Hash: {0}", hashResult.Format( Encoding.UTF8, "x2" );
CalculateSha384Hash(QuickIOPathInfo pathInfo)
File content hash calculation using SHA384
public static QuickIOHashResult CalculateSha384Hash(QuickIOPathInfo pathInfo)
Returns
QuickIOHashResult
Example
// Show human readable hash
QuickIOHashResult hashResult = QuickIOFile.CalculateSha384Hash( "C:\temp\image.bin" );
Console.WriteLine("Hash: {0}", hashResult.Format( Encoding.UTF8, "x2" );
CalculateSha512Hash(QuickIOPathInfo pathInfo)
File content hash calculation using SHA512
public static QuickIOHashResult CalculateSha512Hash(QuickIOPathInfo pathInfo)
Returns
QuickIOHashResult
Remarks
Not compatible with FIPShttp://msdn.microsoft.com/de-de/library/hydyw22a(v=vs.110).aspx
Example
// Show human readable hash
QuickIOHashResult hashResult = QuickIOFile.CalculateSha512Hash( "C:\temp\image.bin" );
Console.WriteLine("Hash: {0}", hashResult.Format( Encoding.UTF8, "x2" );
Copy(String uncSourceFullName, String uncTargetFullName, Boolean overwrite)
Copies an existing file. Overwrites an existing file if overwrite is true
public static void Copy(String uncSourceFullName, String uncTargetFullName, Boolean overwrite)
Parameters
uncSourceFullName
StringThe file to copy.
uncTargetFullName
StringTarget file
overwrite
Booleantrue to overwrite existing files
Remarks
http://msdn.microsoft.com/en-us/library/c6cfw35a(v=vs.110).aspx
CopyToDirectory(QuickIOFileInfo sourceFileName, QuickIODirectoryInfo targetDirectory, String newFileName, Boolean overwrite)
Copies an existing file. Overwrites an existing file if overwrite is true
public static void CopyToDirectory(QuickIOFileInfo sourceFileName, QuickIODirectoryInfo targetDirectory, String newFileName, Boolean overwrite)
Parameters
sourceFileName
QuickIOFileInfoThe file to copy.
targetDirectory
QuickIODirectoryInfoTarget directory
newFileName
StringNew File name. Null or empty to use sourceFileName' name
overwrite
Booleantrue to overwrite existing files
Remarks
http://msdn.microsoft.com/en-us/library/c6cfw35a(v=vs.110).aspx
CopyToDirectory(String sourceFileName, String targetDirectory, String newFileName, Boolean overwrite)
Copies an existing file. Overwrites an existing file if overwrite is true
public static void CopyToDirectory(String sourceFileName, String targetDirectory, String newFileName, Boolean overwrite)
Parameters
sourceFileName
StringThe file to copy.
targetDirectory
StringTarget directory
newFileName
StringNew File name. Null or empty to use sourceFileName's name
overwrite
Booleantrue to overwrite existing file
Remarks
http://msdn.microsoft.com/en-us/library/c6cfw35a(v=vs.110).aspx
Create(QuickIOPathInfo pathInfo, Int32 bufferSize)
Creates or overwrites the specified file.
public static FileStream Create(QuickIOPathInfo pathInfo, Int32 bufferSize)
Parameters
pathInfo
QuickIOPathInfoThe name of the file.
bufferSize
Int32The number of bytes buffered for reads and writes to the file.
Returns
A FileStream with the specified buffer size that provides read/write access to the file specified in .
Remarks
http://msdn.microsoft.com/en-us/library/981h90e5(v=vs.110).aspx
Create(QuickIOPathInfo pathInfo, FileAccess fileAccess, FileShare fileShare, FileMode fileMode, FileAttributes fileAttributes)
Creates a new file.
public static void Create(QuickIOPathInfo pathInfo, FileAccess fileAccess, FileShare fileShare, FileMode fileMode, FileAttributes fileAttributes)
Parameters
pathInfo
QuickIOPathInfoThe path to the file.
fileAccess
FileAccessFileAccess - default Write
fileShare
FileSharefileMode
FileModeFileMode - default Create
fileAttributes
FileAttributesFileAttributes - default 0 (none)
Exceptions
PathAlreadyExistsException
The specified path already exists.
PathNotFoundException
One or more intermediate directories do not exist; this function will only create the final directory in the path.
Create(String path, Int32 bufferSize)
Creates or overwrites the specified file.
public static FileStream Create(String path, Int32 bufferSize)
Parameters
path
StringThe name of the file.
bufferSize
Int32The number of bytes buffered for reads and writes to the file.
Returns
A FileStream with the specified buffer size that provides read/write access to the file specified in .
Remarks
http://msdn.microsoft.com/en-us/library/981h90e5(v=vs.110).aspx
Create(String fullName, FileAccess fileAccess, FileShare fileShare, FileMode fileMode, FileAttributes fileAttributes)
Creates a new file.
public static void Create(String fullName, FileAccess fileAccess, FileShare fileShare, FileMode fileMode, FileAttributes fileAttributes)
Parameters
fullName
StringThe path to the file.
fileAccess
FileAccessFileAccess - default Write
fileShare
FileSharefileMode
FileModeFileMode - default Create
fileAttributes
FileAttributesFileAttributes - default 0 (none)
Exceptions
PathAlreadyExistsException
The specified path already exists.
PathNotFoundException
One or more intermediate directories do not exist; this function will only create the final directory in the path.
CreateText(QuickIOPathInfo pathInfo)
Creates or opens a file for writing UTF-8 encoded text.
public static StreamWriter CreateText(QuickIOPathInfo pathInfo)
Parameters
pathInfo
QuickIOPathInfoThe file.
Returns
A StreamWriter that writes to the specified file using UTF-8 encoding.
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.createtext(v=vs.110).aspx
CreateText(String path)
Creates or opens a file for writing UTF-8 encoded text.
public static StreamWriter CreateText(String path)
Parameters
path
StringThe file.
Returns
A StreamWriter that writes to the specified file using UTF-8 encoding.
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.createtext(v=vs.110).aspx
Delete(QuickIOPathInfo pathInfo)
Deletes the file.
public static void Delete(QuickIOPathInfo pathInfo)
Parameters
pathInfo
QuickIOPathInfoThe file to be deleted.
Exceptions
FileNotFoundException
File does not exist.
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.delete(v=vs.110).aspx
Delete(String path)
Deletes the file.
public static void Delete(String path)
Parameters
path
StringThe fullname of the file to be deleted.
Exceptions
FileNotFoundException
File does not exist.
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.delete(v=vs.110).aspx
Exists(QuickIOPathInfo pathInfo)
Checks whether the specified file exists.
public static Boolean Exists(QuickIOPathInfo pathInfo)
Parameters
pathInfo
QuickIOPathInfoThe the file to check.
Returns
if the caller has the required permissions and path contains the name of an existing file; otherwise,
Exceptions
UnmatchedFileSystemEntryTypeException
Searched for file but found folder.
InvalidPathException
Path is invalid.
Remarks
The original Exists method returns also false on null! http://msdn.microsoft.com/en-us/library/system.io.file.exists(v=vs.110).aspx
Exists(String path)
Checks whether the specified file exists.
public static Boolean Exists(String path)
Parameters
path
StringThe path to check.
Returns
if the caller has the required permissions and path contains the name of an existing file; otherwise,
Exceptions
UnmatchedFileSystemEntryTypeException
Searched for file but found folder.
InvalidPathException
Path is invalid.
Remarks
The original Exists method returns also false on null! http://msdn.microsoft.com/en-us/library/system.io.file.exists(v=vs.110).aspx
GetAttributes(QuickIOFileInfo info)
Gets the FileAttributes of the directory or file.
public static FileAttributes GetAttributes(QuickIOFileInfo info)
Parameters
info
QuickIOFileInfoA directory or file.
Returns
The FileAttributes of the directory or file.
GetAttributes(QuickIOPathInfo info)
Gets the FileAttributes of the directory or file.
public static FileAttributes GetAttributes(QuickIOPathInfo info)
Parameters
info
QuickIOPathInfoA directory or file.
Returns
The FileAttributes of the directory or file.
GetAttributes(String path)
Gets the FileAttributes of the directory or file.
public static FileAttributes GetAttributes(String path)
Parameters
path
StringThe path to the directory or file.
Returns
The FileAttributes of the directory or file.
GetCreationTime(QuickIOFileInfo info)
Returns the creation time of the file or directory
public static DateTime GetCreationTime(QuickIOFileInfo info)
Parameters
info
QuickIOFileInfoAffected file or directory
Returns
A DateTime structure.
Exceptions
PathNotFoundException
No entry found for passed path
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.getcreationtime(v=vs.110).aspx
GetCreationTime(QuickIOPathInfo info)
Returns the creation time of the file or directory
public static DateTime GetCreationTime(QuickIOPathInfo info)
Parameters
info
QuickIOPathInfoAffected file or directory
Returns
A DateTime structure.
Exceptions
PathNotFoundException
No entry found for passed path
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.getcreationtime(v=vs.110).aspx
GetCreationTime(String path)
Returns the creation time of the file or directory
public static DateTime GetCreationTime(String path)
Parameters
path
StringAffected file or directory
Returns
A DateTime structure.
Exceptions
PathNotFoundException
No entry found for passed path
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.getcreationtime(v=vs.110).aspx
GetCreationTimeUtc(QuickIOFileInfo info)
Returns the creation time of the file or directory (UTC)
public static DateTime GetCreationTimeUtc(QuickIOFileInfo info)
Parameters
info
QuickIOFileInfoAffected file or directory
Returns
A DateTime structure. (UTC)
Exceptions
PathNotFoundException
No entry found for passed path
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.getcreationtimeutc(v=vs.110).aspx
GetCreationTimeUtc(QuickIOPathInfo info)
Returns the creation time of the file or directory (UTC)
public static DateTime GetCreationTimeUtc(QuickIOPathInfo info)
Parameters
info
QuickIOPathInfoAffected file or directory
Returns
A DateTime structure. (UTC)
Exceptions
PathNotFoundException
No entry found for passed path
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.getcreationtimeutc(v=vs.110).aspx
GetCreationTimeUtc(String path)
Returns the creation time of the file or directory (UTC)
public static DateTime GetCreationTimeUtc(String path)
Parameters
path
StringAffected file or directory
Returns
A DateTime structure. (UTC)
Exceptions
PathNotFoundException
No entry found for passed path
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.getcreationtimeutc(v=vs.110).aspx
GetDirectoryRoot(QuickIOFileInfo info)
Returns the root information
public static QuickIOPathInfo GetDirectoryRoot(QuickIOFileInfo info)
Parameters
info
QuickIOFileInfoA file or directory.
Returns
A QuickIOPathInfo that represents the root or null if info is root.
Remarks
http://msdn.microsoft.com/en-us/library/system.io.directory.getdirectoryroot(v=vs.110).aspx
GetDirectoryRoot(QuickIOPathInfo info)
Returns the root information
public static QuickIOPathInfo GetDirectoryRoot(QuickIOPathInfo info)
Parameters
info
QuickIOPathInfoA file or directory.
Returns
A QuickIOPathInfo that represents the root or null if info is root.
Remarks
http://msdn.microsoft.com/en-us/library/system.io.directory.getdirectoryroot(v=vs.110).aspx
GetDirectoryRoot(String path)
Returns the root information
public static QuickIOPathInfo GetDirectoryRoot(String path)
Parameters
path
StringThe path of a file or directory.
Returns
A QuickIOPathInfo that represents the root or null if path is root.
Remarks
http://msdn.microsoft.com/en-us/library/system.io.directory.getdirectoryroot(v=vs.110).aspx
GetLastAccessTime(QuickIOFileInfo info)
Returns the time of last access of the file or directory
public static DateTime GetLastAccessTime(QuickIOFileInfo info)
Parameters
info
QuickIOFileInfoAffected file or directory
Returns
A DateTime structure.
Exceptions
PathNotFoundException
No entry found for passed path
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.getlastaccesstime(v=vs.110).aspx
GetLastAccessTime(QuickIOPathInfo info)
Returns the time of last access of the file or directory
public static DateTime GetLastAccessTime(QuickIOPathInfo info)
Parameters
info
QuickIOPathInfoAffected file or directory
Returns
A DateTime structure.
Exceptions
PathNotFoundException
No entry found for passed path
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.getlastaccesstime(v=vs.110).aspx
GetLastAccessTime(String path)
Returns the time of last access of the file or directory
public static DateTime GetLastAccessTime(String path)
Parameters
path
StringAffected file or directory
Returns
A DateTime structure.
Exceptions
PathNotFoundException
No entry found for passed path
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.getlastaccesstime(v=vs.110).aspx
GetLastAccessTimeUtc(QuickIOFileInfo info)
Returns the time of last access of the file or directory (UTC)
public static DateTime GetLastAccessTimeUtc(QuickIOFileInfo info)
Parameters
info
QuickIOFileInfoAffected file or directory
Returns
A DateTime structure. (UTC)
Exceptions
PathNotFoundException
No entry found for passed path
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.getlastaccesstimeutc(v=vs.110).aspx
GetLastAccessTimeUtc(QuickIOPathInfo info)
Returns the time of last access of the file or directory (UTC)
public static DateTime GetLastAccessTimeUtc(QuickIOPathInfo info)
Parameters
info
QuickIOPathInfoAffected file or directory
Returns
A DateTime structure. (UTC)
Exceptions
PathNotFoundException
No entry found for passed path
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.getlastaccesstimeutc(v=vs.110).aspx
GetLastAccessTimeUtc(String path)
Returns the time of last access of the file or directory (UTC)
public static DateTime GetLastAccessTimeUtc(String path)
Parameters
path
StringAffected file or directory
Returns
A DateTime structure. (UTC)
Exceptions
PathNotFoundException
No entry found for passed path
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.getlastaccesstimeutc(v=vs.110).aspx
GetLastWriteTime(QuickIOFileInfo info)
Returns the time of the file or directory was last written
public static DateTime GetLastWriteTime(QuickIOFileInfo info)
Parameters
info
QuickIOFileInfoAffected file or directory
Returns
A DateTime structure.
Exceptions
PathNotFoundException
No entry found for passed path
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.getlastwritetime(v=vs.110).aspx
GetLastWriteTime(QuickIOPathInfo info)
Returns the time of the file or directory was last written
public static DateTime GetLastWriteTime(QuickIOPathInfo info)
Parameters
info
QuickIOPathInfoAffected file or directory
Returns
A DateTime structure.
Exceptions
PathNotFoundException
No entry found for passed path
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.getlastwritetime(v=vs.110).aspx
GetLastWriteTime(String path)
Returns the time of the file or directory was last written
public static DateTime GetLastWriteTime(String path)
Parameters
path
StringAffected file or directory
Returns
A DateTime structure.
Exceptions
PathNotFoundException
No entry found for passed path
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.getlastwritetime(v=vs.110).aspx
GetLastWriteTimeUtc(QuickIOFileInfo info)
Returns the time of the file or directory was last written (UTC)
public static DateTime GetLastWriteTimeUtc(QuickIOFileInfo info)
Parameters
info
QuickIOFileInfoAffected file or directory
Returns
A DateTime structure. (UTC)
Exceptions
PathNotFoundException
No entry found for passed path
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.getlastwritetimeutc(v=vs.110).aspx
GetLastWriteTimeUtc(QuickIOPathInfo info)
Returns the time of the file or directory was last written (UTC)
public static DateTime GetLastWriteTimeUtc(QuickIOPathInfo info)
Parameters
info
QuickIOPathInfoAffected file or directory
Returns
A DateTime structure. (UTC)
Exceptions
PathNotFoundException
No entry found for passed path
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.getlastwritetimeutc(v=vs.110).aspx
GetLastWriteTimeUtc(String path)
Returns the time of the file or directory was last written (UTC)
public static DateTime GetLastWriteTimeUtc(String path)
Parameters
path
StringAffected file or directory
Returns
A DateTime structure. (UTC)
Exceptions
PathNotFoundException
No entry found for passed path
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.getlastwritetimeutc(v=vs.110).aspx
Move(QuickIOPathInfo sourceFileInfo, QuickIODirectoryInfo destinationFolder)
Moves a file, providing the option to give a new file name.
public static void Move(QuickIOPathInfo sourceFileInfo, QuickIODirectoryInfo destinationFolder)
Parameters
sourceFileInfo
QuickIOPathInfoThe file to move.
destinationFolder
QuickIODirectoryInfoTarget directory to move the file.
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.move(v=vs.110).aspx
Move(QuickIOPathInfo sourceFileInfo, QuickIOPathInfo destinationFolder)
Moves a file, providing the option to give a new file name.
public static void Move(QuickIOPathInfo sourceFileInfo, QuickIOPathInfo destinationFolder)
Parameters
sourceFileInfo
QuickIOPathInfoThe file to move.
destinationFolder
QuickIOPathInfoTarget directory to move the file.
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.move(v=vs.110).aspx
Move(String sourceFileName, String destinationFileName)
Moves a specified file to a new location, providing the option to give a new file name.
public static void Move(String sourceFileName, String destinationFileName)
Parameters
sourceFileName
StringThe name of the file to move.
destinationFileName
StringThe new path for the file. Parent directory must exist.
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.move(v=vs.110).aspx
Open(QuickIOPathInfo info, FileMode mode)
Opens a FileStream
public static FileStream Open(QuickIOPathInfo info, FileMode mode)
Parameters
info
QuickIOPathInfoThe file to open.
mode
FileModeFileMode
Returns
A FileStream with read and write access and not shared.
Remarks
http://msdn.microsoft.com/en-us/library/b9skfh7s(v=vs.110).aspx
Open(QuickIOPathInfo pathInfo, FileMode mode, FileAccess access)
Opens a FileStream
public static FileStream Open(QuickIOPathInfo pathInfo, FileMode mode, FileAccess access)
Parameters
pathInfo
QuickIOPathInfoThe file to open.
mode
FileModeFileMode
access
FileAccessFileAccess
Returns
An unshared FileStream
Remarks
http://msdn.microsoft.com/en-us/library/s67691sb(v=vs.110).aspx
Open(QuickIOPathInfo pathInfo, FileMode mode, FileAccess access, FileShare share)
Opens a FileStream
public static FileStream Open(QuickIOPathInfo pathInfo, FileMode mode, FileAccess access, FileShare share)
Parameters
pathInfo
QuickIOPathInfoThe file to open.
mode
FileModeFileMode
access
FileAccessFileAccess
share
FileShareFileShare
Returns
FileStream
Remarks
http://msdn.microsoft.com/en-us/library/y973b725(v=vs.110).aspx
Open(String path, FileMode mode)
Opens a FileStream
public static FileStream Open(String path, FileMode mode)
Parameters
path
StringThe file to open.
mode
FileModeFileMode
Returns
A FileStream with read and write access and not shared.
Remarks
http://msdn.microsoft.com/en-us/library/b9skfh7s(v=vs.110).aspx
Open(String path, FileMode mode, FileAccess access)
Opens a FileStream
public static FileStream Open(String path, FileMode mode, FileAccess access)
Parameters
path
StringThe file to open.
mode
FileModeFileMode
access
FileAccessFileAccess
Returns
An unshared FileStream
Remarks
http://msdn.microsoft.com/en-us/library/s67691sb(v=vs.110).aspx
Open(String path, FileMode mode, FileAccess access, FileShare share)
Opens a FileStream
public static FileStream Open(String path, FileMode mode, FileAccess access, FileShare share)
Parameters
path
StringThe file to open.
mode
FileModeFileMode
access
FileAccessFileAccess
share
FileShareFileShare
Returns
A FileStream
Remarks
http://msdn.microsoft.com/en-us/library/y973b725(v=vs.110).aspx
OpenAppend(QuickIOPathInfo pathInfo)
Opens an existing file or creates a new file for appending.
public static FileStream OpenAppend(QuickIOPathInfo pathInfo)
Parameters
pathInfo
QuickIOPathInfoThe file.
Returns
An unshared FileStream with Write access.
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.openwrite(v=vs.110).aspx
OpenAppend(String path)
Opens an existing file or creates a new file for appending.
public static FileStream OpenAppend(String path)
Parameters
path
StringThe file.
Returns
An unshared FileStream with Write access.
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.openwrite(v=vs.110).aspx
OpenAppendFileStream(QuickIOPathInfo pathInfo, FileAccess fileAccess, FileMode fileOption, FileShare shareMode, Int32 buffer)
Opens a FileStream
private static FileStream OpenAppendFileStream(QuickIOPathInfo pathInfo, FileAccess fileAccess, FileMode fileOption, FileShare shareMode, Int32 buffer)
OpenFileStream(QuickIOPathInfo pathInfo, FileAccess fileAccess, FileMode fileOption, FileShare shareMode, Int32 buffer)
Opens a FileStream
private static FileStream OpenFileStream(QuickIOPathInfo pathInfo, FileAccess fileAccess, FileMode fileOption, FileShare shareMode, Int32 buffer)
OpenRead(QuickIOPathInfo pathInfo)
Opens an existing file for reading.
public static FileStream OpenRead(QuickIOPathInfo pathInfo)
Parameters
pathInfo
QuickIOPathInfoThe file to be opened for reading.
Returns
A read-only FileStream on the specified path.
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.openread(v=vs.110).aspx
OpenRead(String path)
Opens an existing file for reading.
public static FileStream OpenRead(String path)
Parameters
path
StringThe file to be opened for reading.
Returns
A read-only FileStream on the specified path.
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.openread(v=vs.110).aspx
OpenText(QuickIOPathInfo pathInfo)
Opens an existing UTF-8 encoded text file for reading.
public static StreamReader OpenText(QuickIOPathInfo pathInfo)
Parameters
pathInfo
QuickIOPathInfoThe file.
Returns
A StreamReader.
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.opentext(v=vs.110).aspx
OpenText(String path)
Opens an existing UTF-8 encoded text file for reading.
public static StreamReader OpenText(String path)
Parameters
path
StringThe file to be opened for reading.
Returns
A StreamReader.
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.opentext(v=vs.110).aspx
OpenWrite(QuickIOPathInfo pathInfo)
Opens an existing file or creates a new file for writing.
public static FileStream OpenWrite(QuickIOPathInfo pathInfo)
Parameters
pathInfo
QuickIOPathInfoThe file.
Returns
An unshared FileStream with Write access.
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.openwrite(v=vs.110).aspx
OpenWrite(String path)
Opens an existing file or creates a new file for writing.
public static FileStream OpenWrite(String path)
Parameters
path
StringThe file.
Returns
An unshared FileStream with Write access.
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.openwrite(v=vs.110).aspx
ReadAllBytes(QuickIOPathInfo pathInfo)
Reads the contents of the file into a byte collection.
public static Byte[] ReadAllBytes(QuickIOPathInfo pathInfo)
Parameters
pathInfo
QuickIOPathInfoThe file.
Returns
A byte collection containing the contents.
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.readallbytes(v=vs.110).aspx
ReadAllBytes(String path)
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
StringThe file to open for reading.
Returns
A byte array containing the contents of the file.
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.readallbytes(v=vs.110).aspx
ReadAllLines(QuickIOPathInfo pathInfo)
Reads all lines.
public static IEnumerable<String> ReadAllLines(QuickIOPathInfo pathInfo)
Parameters
pathInfo
QuickIOPathInfoThe file.
Returns
A string collection containing all lines.
Remarks
http://msdn.microsoft.com/en-us/library/s2tte0y1(v=vs.110).aspx
ReadAllLines(QuickIOPathInfo pathInfo, Encoding encoding)
Reads all lines with the specified encoding
public static IEnumerable<String> ReadAllLines(QuickIOPathInfo pathInfo, Encoding encoding)
Parameters
pathInfo
QuickIOPathInfoThe file.
encoding
EncodingThe encoding applied to the contents.
Returns
A string collection containing all lines.
Remarks
http://msdn.microsoft.com/en-us/library/bsy4fhsa(v=vs.110).aspx
ReadAllLines(String path)
Reads all lines.
public static IEnumerable<String> ReadAllLines(String path)
Parameters
path
StringThe file.
Returns
A string collection containing all lines.
Remarks
http://msdn.microsoft.com/en-us/library/s2tte0y1(v=vs.110).aspx
ReadAllLines(String path, Encoding encoding)
Reads all lines with the specified encoding
public static IEnumerable<String> ReadAllLines(String path, Encoding encoding)
Parameters
path
StringThe file.
encoding
EncodingThe encoding applied to the contents.
Returns
A string collection containing all lines.
Remarks
http://msdn.microsoft.com/en-us/library/bsy4fhsa(v=vs.110).aspx
ReadAllText(QuickIOPathInfo pathInfo)
Reads all text.
public static String ReadAllText(QuickIOPathInfo pathInfo)
Parameters
pathInfo
QuickIOPathInfoThe file.
Returns
A string represents the content.
ReadAllText(QuickIOPathInfo pathInfo, Encoding encoding)
Reads all text with the specified encoding.
public static String ReadAllText(QuickIOPathInfo pathInfo, Encoding encoding)
Parameters
pathInfo
QuickIOPathInfoThe file.
encoding
EncodingThe encoding applied to the content.
Returns
A string represents the content.
Remarks
http://msdn.microsoft.com/en-us/library/ms143369(v=vs.110).aspx
ReadAllText(String path)
Reads all text.
public static String ReadAllText(String path)
Parameters
path
StringThe file.
Returns
A string represents the content.
Remarks
http://msdn.microsoft.com/en-us/library/s2tte0y1(v=vs.110).aspx
ReadAllText(String path, Encoding encoding)
Reads all text with the specified encoding.
public static String ReadAllText(String path, Encoding encoding)
Parameters
path
StringThe file.
encoding
EncodingThe encoding applied to the content.
Returns
A string represents the content.
Remarks
http://msdn.microsoft.com/en-us/library/ms143369(v=vs.110).aspx
RemoveAttribute(QuickIOFileInfo info, FileAttributes attribute)
Removes the specified attribute from file or directory
public static Boolean RemoveAttribute(QuickIOFileInfo info, FileAttributes attribute)
Parameters
info
QuickIOFileInfoA directory or file.
attribute
FileAttributesAttribute to remove
Returns
true if removed. false if not exists in attributes
RemoveAttribute(QuickIOPathInfo info, FileAttributes attribute)
Removes the specified attribute from file or directory
public static Boolean RemoveAttribute(QuickIOPathInfo info, FileAttributes attribute)
Parameters
info
QuickIOPathInfoA directory or file.
attribute
FileAttributesAttribute to remove
Returns
true if removed. false if not exists in attributes
RemoveAttribute(String path, FileAttributes attribute)
Removes the specified attribute from file or directory
public static Boolean RemoveAttribute(String path, FileAttributes attribute)
Parameters
path
StringA directory or file.
attribute
FileAttributesAttribute to remove
Returns
true if removed. false if not exists in attributes
SetAllFileTimes(QuickIOFileInfo info, DateTime creationTime, DateTime lastAccessTime, DateTime lastWriteTime)
Sets the time the file was created.
public static void SetAllFileTimes(QuickIOFileInfo info, DateTime creationTime, DateTime lastAccessTime, DateTime lastWriteTime)
Parameters
info
QuickIOFileInfoAffected file or directory
creationTime
DateTimeThe time that is to be used
lastAccessTime
DateTimeThe time that is to be used
lastWriteTime
DateTimeThe time that is to be used
SetAllFileTimes(QuickIOPathInfo info, DateTime creationTime, DateTime lastAccessTime, DateTime lastWriteTime)
Sets the time the file was created.
public static void SetAllFileTimes(QuickIOPathInfo info, DateTime creationTime, DateTime lastAccessTime, DateTime lastWriteTime)
Parameters
info
QuickIOPathInfoAffected file or directory
creationTime
DateTimeThe time that is to be used
lastAccessTime
DateTimeThe time that is to be used
lastWriteTime
DateTimeThe time that is to be used
SetAllFileTimes(String path, DateTime creationTime, DateTime lastAccessTime, DateTime lastWriteTime)
Sets the time the file was created.
public static void SetAllFileTimes(String path, DateTime creationTime, DateTime lastAccessTime, DateTime lastWriteTime)
Parameters
path
StringAffected file or directory
creationTime
DateTimeThe time that is to be used
lastAccessTime
DateTimeThe time that is to be used
lastWriteTime
DateTimeThe time that is to be used
SetAllFileTimesUtc(QuickIOFileInfo info, DateTime creationTimeUtc, DateTime lastAccessTimeUtc, DateTime lastWriteTimeUtc)
Sets the dates and times of given directory or file.
public static void SetAllFileTimesUtc(QuickIOFileInfo info, DateTime creationTimeUtc, DateTime lastAccessTimeUtc, DateTime lastWriteTimeUtc)
Parameters
info
QuickIOFileInfoAffected file or directory
creationTimeUtc
DateTimeThe time that is to be used (UTC)
lastAccessTimeUtc
DateTimeThe time that is to be used (UTC)
lastWriteTimeUtc
DateTimeThe time that is to be used (UTC)
SetAllFileTimesUtc(QuickIOPathInfo info, DateTime creationTimeUtc, DateTime lastAccessTimeUtc, DateTime lastWriteTimeUtc)
Sets the dates and times of given directory or file.
public static void SetAllFileTimesUtc(QuickIOPathInfo info, DateTime creationTimeUtc, DateTime lastAccessTimeUtc, DateTime lastWriteTimeUtc)
Parameters
info
QuickIOPathInfoAffected file or directory
creationTimeUtc
DateTimeThe time that is to be used (UTC)
lastAccessTimeUtc
DateTimeThe time that is to be used (UTC)
lastWriteTimeUtc
DateTimeThe time that is to be used (UTC)
SetAllFileTimesUtc(String path, DateTime creationTimeUtc, DateTime lastAccessTimeUtc, DateTime lastWriteTimeUtc)
Sets the dates and times of given directory or file.
public static void SetAllFileTimesUtc(String path, DateTime creationTimeUtc, DateTime lastAccessTimeUtc, DateTime lastWriteTimeUtc)
Parameters
path
StringAffected file or directory
creationTimeUtc
DateTimeThe time that is to be used (UTC)
lastAccessTimeUtc
DateTimeThe time that is to be used (UTC)
lastWriteTimeUtc
DateTimeThe time that is to be used (UTC)
SetAttributes(QuickIOFileInfo info, FileAttributes attributes)
Gets the FileAttributes of the directory or file.
public static void SetAttributes(QuickIOFileInfo info, FileAttributes attributes)
Parameters
info
QuickIOFileInfoA directory or file.
attributes
FileAttributesNew attributes to set.
Returns
The FileAttributes of the directory or file.
SetAttributes(QuickIOPathInfo info, FileAttributes attributes)
Gets the FileAttributes of the directory or file.
public static void SetAttributes(QuickIOPathInfo info, FileAttributes attributes)
Parameters
info
QuickIOPathInfoA directory or file.
attributes
FileAttributesNew attributes to set.
Returns
The FileAttributes of the directory or file.
SetAttributes(String path, FileAttributes attributes)
Gets the FileAttributes of the directory or file.
public static void SetAttributes(String path, FileAttributes attributes)
Parameters
path
StringThe path to the directory or file.
attributes
FileAttributesNew attributes to set.
Returns
The FileAttributes of the directory or file.
SetCreationTime(QuickIOFileInfo info, DateTime creationTime)
Defines the time at which the file or directory was created
public static void SetCreationTime(QuickIOFileInfo info, DateTime creationTime)
Parameters
info
QuickIOFileInfoAffected file or directory
creationTime
DateTimeThe time that is to be used
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.setcreationtime(v=vs.110).aspx
SetCreationTime(QuickIOPathInfo info, DateTime creationTime)
Defines the time at which the file or directory was created
public static void SetCreationTime(QuickIOPathInfo info, DateTime creationTime)
Parameters
info
QuickIOPathInfoAffected file or directory
creationTime
DateTimeThe time that is to be used
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.setcreationtime(v=vs.110).aspx
SetCreationTime(String path, DateTime creationTime)
Defines the time at which the file or directory was created
public static void SetCreationTime(String path, DateTime creationTime)
Parameters
path
StringAffected file or directory
creationTime
DateTimeThe time that is to be used
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.setcreationtime(v=vs.110).aspx
SetCreationTimeUtc(QuickIOFileInfo info, DateTime creationTimeUtc)
Defines the time at which the file or directory was created (UTC)
public static void SetCreationTimeUtc(QuickIOFileInfo info, DateTime creationTimeUtc)
Parameters
info
QuickIOFileInfoAffected file or directory
creationTimeUtc
DateTimeThe time that is to be used (UTC)
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.setcreationtimeutc(v=vs.110).aspx
SetCreationTimeUtc(QuickIOPathInfo info, DateTime creationTimeUtc)
Defines the time at which the file or directory was created (UTC)
public static void SetCreationTimeUtc(QuickIOPathInfo info, DateTime creationTimeUtc)
Parameters
info
QuickIOPathInfoAffected file or directory
creationTimeUtc
DateTimeThe time that is to be used (UTC)
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.setcreationtimeutc(v=vs.110).aspx
SetCreationTimeUtc(String path, DateTime creationTimeUtc)
Defines the time at which the file or directory was created (UTC)
public static void SetCreationTimeUtc(String path, DateTime creationTimeUtc)
Parameters
path
StringAffected file or directory
creationTimeUtc
DateTimeThe time that is to be used (UTC)
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.setcreationtimeutc(v=vs.110).aspx
SetLastAccessTime(QuickIOFileInfo info, DateTime lastAccessTime)
Defines the time at which the file or directory was last accessed
public static void SetLastAccessTime(QuickIOFileInfo info, DateTime lastAccessTime)
Parameters
info
QuickIOFileInfoAffected file or directory
lastAccessTime
DateTimeThe time that is to be used
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.setlastaccesstime(v=vs.110).aspx
SetLastAccessTime(QuickIOPathInfo info, DateTime lastAccessTime)
Defines the time at which the file or directory was last accessed
public static void SetLastAccessTime(QuickIOPathInfo info, DateTime lastAccessTime)
Parameters
info
QuickIOPathInfoAffected file or directory
lastAccessTime
DateTimeThe time that is to be used
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.setlastaccesstime(v=vs.110).aspx
SetLastAccessTime(String path, DateTime lastAccessTime)
Defines the time at which the file or directory was last accessed
public static void SetLastAccessTime(String path, DateTime lastAccessTime)
Parameters
path
StringAffected file or directory
lastAccessTime
DateTimeThe time that is to be used
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.setcreationtime(v=vs.110).aspx
SetLastAccessTimeUtc(QuickIOFileInfo info, DateTime lastAccessTimeUtc)
Defines the time at which the file or directory was last accessed (UTC)
public static void SetLastAccessTimeUtc(QuickIOFileInfo info, DateTime lastAccessTimeUtc)
Parameters
info
QuickIOFileInfoAffected file or directory
lastAccessTimeUtc
DateTimeThe time that is to be used (UTC)
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.setlastaccesstimeutc(v=vs.110).aspx
SetLastAccessTimeUtc(QuickIOPathInfo info, DateTime lastAccessTimeUtc)
Defines the time at which the file or directory was last accessed (UTC)
public static void SetLastAccessTimeUtc(QuickIOPathInfo info, DateTime lastAccessTimeUtc)
Parameters
info
QuickIOPathInfoAffected file or directory
lastAccessTimeUtc
DateTimeThe time that is to be used (UTC)
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.setlastaccesstimeutc(v=vs.110).aspx
SetLastAccessTimeUtc(String path, DateTime lastAccessTimeUtc)
Defines the time at which the file or directory was last accessed (UTC)
public static void SetLastAccessTimeUtc(String path, DateTime lastAccessTimeUtc)
Parameters
path
StringAffected file or directory
lastAccessTimeUtc
DateTimeThe time that is to be used (UTC)
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.setlastaccesstimeutc(v=vs.110).aspx
SetLastWriteTime(QuickIOFileInfo info, DateTime lastWriteTime)
Defines the time at which the file or directory was last written
public static void SetLastWriteTime(QuickIOFileInfo info, DateTime lastWriteTime)
Parameters
info
QuickIOFileInfoAffected file or directory
lastWriteTime
DateTimeThe time that is to be used
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.setlastwritetime(v=vs.110).aspx
SetLastWriteTime(QuickIOPathInfo info, DateTime lastWriteTime)
Defines the time at which the file or directory was last written
public static void SetLastWriteTime(QuickIOPathInfo info, DateTime lastWriteTime)
Parameters
info
QuickIOPathInfoAffected file or directory
lastWriteTime
DateTimeThe time that is to be used
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.setlastwritetime(v=vs.110).aspx
SetLastWriteTime(String path, DateTime lastWriteTime)
Defines the time at which the file or directory was last written
public static void SetLastWriteTime(String path, DateTime lastWriteTime)
Parameters
path
StringAffected file or directory
lastWriteTime
DateTimeThe time that is to be used
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.setcreationtime(v=vs.110).aspx
SetLastWriteTimeUtc(QuickIOFileInfo info, DateTime lastWriteTimeUtc)
Defines the time at which the file or directory was last written (UTC)
public static void SetLastWriteTimeUtc(QuickIOFileInfo info, DateTime lastWriteTimeUtc)
Parameters
info
QuickIOFileInfoAffected file or directory
lastWriteTimeUtc
DateTimeThe time that is to be used (UTC)
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.setlastwritetimeutc(v=vs.110).aspx
SetLastWriteTimeUtc(QuickIOPathInfo info, DateTime lastWriteTimeUtc)
Defines the time at which the file or directory was last written (UTC)
public static void SetLastWriteTimeUtc(QuickIOPathInfo info, DateTime lastWriteTimeUtc)
Parameters
info
QuickIOPathInfoAffected file or directory
lastWriteTimeUtc
DateTimeThe time that is to be used (UTC)
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.setlastwritetimeutc(v=vs.110).aspx
SetLastWriteTimeUtc(String path, DateTime lastWriteTimeUtc)
Defines the time at which the file or directory was last written (UTC)
public static void SetLastWriteTimeUtc(String path, DateTime lastWriteTimeUtc)
Parameters
path
StringAffected file or directory
lastWriteTimeUtc
DateTimeThe time that is to be used (UTC)
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.setlastwritetimeutc(v=vs.110).aspx
WriteAllBytes(QuickIOPathInfo pathInfo, Byte[] bytes)
Writes the specified byte array. If the file already exists, it is overwritten.
public static void WriteAllBytes(QuickIOPathInfo pathInfo, Byte[] bytes)
Parameters
pathInfo
QuickIOPathInfoThe file.
bytes
Byte[]The bytes to write.
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.writeallbytes(v=vs.110).aspx
WriteAllBytes(QuickIOPathInfo pathInfo, IEnumerable bytes)
Writes the specified byte array. If the file already exists, it is overwritten.
public static void WriteAllBytes(QuickIOPathInfo pathInfo, IEnumerable bytes)
Parameters
pathInfo
QuickIOPathInfoThe file.
bytes
IEnumerableThe bytes to write.
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.writeallbytes(v=vs.110).aspx
WriteAllBytes(String path, Byte[] bytes)
Writes the specified byte array. If the file already exists, it is overwritten.
public static void WriteAllBytes(String path, Byte[] bytes)
Parameters
path
StringThe file.
bytes
Byte[]The bytes to write.
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.writeallbytes(v=vs.110).aspx
WriteAllBytes(String path, IEnumerable bytes)
Writes the specified byte array. If the file already exists, it is overwritten.
public static void WriteAllBytes(String path, IEnumerable bytes)
Parameters
path
StringThe file.
bytes
IEnumerableThe bytes to write.
Remarks
http://msdn.microsoft.com/en-us/library/system.io.file.writeallbytes(v=vs.110).aspx
WriteAllLines(QuickIOPathInfo pathInfo, IEnumerable contents)
Writes a collection of strings. Uses UTF-8 without Emitted UTF-8 identifier.
public static void WriteAllLines(QuickIOPathInfo pathInfo, IEnumerable contents)
Parameters
pathInfo
QuickIOPathInfoThe file.
contents
IEnumerableThe lines write to.
Remarks
http://msdn.microsoft.com/en-us/library/dd383693(v=vs.110).aspx
WriteAllLines(QuickIOPathInfo pathInfo, IEnumerable contents, Encoding encoding)
Writes a collection of strings.
public static void WriteAllLines(QuickIOPathInfo pathInfo, IEnumerable contents, Encoding encoding)
Parameters
pathInfo
QuickIOPathInfoThe file.
contents
IEnumerableThe lines write to.
encoding
EncodingThe character encoding to use.
Remarks
http://msdn.microsoft.com/en-us/library/dd383463(v=vs.110).aspx
WriteAllLines(String path, IEnumerable contents)
Writes a collection of strings. Uses UTF-8 without Emitted UTF-8 identifier.
public static void WriteAllLines(String path, IEnumerable contents)
Parameters
path
StringThe file.
contents
IEnumerableThe lines write to.
Remarks
http://msdn.microsoft.com/en-us/library/dd383693(v=vs.110).aspx
WriteAllLines(String path, IEnumerable contents, Encoding encoding)
Writes a collection of strings.
public static void WriteAllLines(String path, IEnumerable contents, Encoding encoding)
Parameters
path
StringThe file.
contents
IEnumerableThe lines write to.
encoding
EncodingThe character encoding to use.
Remarks
http://msdn.microsoft.com/en-us/library/dd383463(v=vs.110).aspx
WriteAllText(QuickIOPathInfo pathInfo, String contents)
Writes the specified string. If the target file already exists, it is overwritten.
public static void WriteAllText(QuickIOPathInfo pathInfo, String contents)
Parameters
pathInfo
QuickIOPathInfoThe file.
contents
StringThe string to write to.
Remarks
http://msdn.microsoft.com/en-us/library/ms143375(v=vs.110).aspx
WriteAllText(QuickIOPathInfo pathInfo, String contents, Encoding encoding)
Writes the specified string. If the target file already exists, it is overwritten.
public static void WriteAllText(QuickIOPathInfo pathInfo, String contents, Encoding encoding)
Parameters
pathInfo
QuickIOPathInfoThe file.
contents
StringThe string to write to.
encoding
EncodingThe encoding to apply to the string.
Remarks
http://msdn.microsoft.com/en-us/library/ms143376(v=vs.110).aspx
WriteAllText(String path, String contents)
Writes the specified string. If the target file already exists, it is overwritten.
public static void WriteAllText(String path, String contents)
Parameters
path
StringThe file.
contents
StringThe string to write to.
Remarks
http://msdn.microsoft.com/en-us/library/ms143375(v=vs.110).aspx
WriteAllText(String path, String contents, Encoding encoding)
Writes the specified string. If the target file already exists, it is overwritten.
public static void WriteAllText(String path, String contents, Encoding encoding)
Parameters
path
StringThe file.
contents
StringThe string to write to.
encoding
EncodingThe encoding to apply to the string.
Remarks
http://msdn.microsoft.com/en-us/library/ms143376(v=vs.110).aspx