Utils_File Class |
Namespace: MicaSystems.Utils
public static class Utils_File
The Utils_File type exposes the following members.
Name | Description | |
---|---|---|
![]() ![]() | CheckAssembliesVersions(DirectoryInfo, DictionaryString, String, Boolean) |
Checks all assemblies versions inside a folder,
based on a dictionary containing files name as key and version as value.
|
![]() ![]() | CheckAssembliesVersions(String, DictionaryString, String, Boolean) |
Checks all assemblies versions inside a folder,
based on a dictionary containing files name as key and version as value.
|
![]() ![]() | CheckDirectoryPathValidity |
Checks the validity of a given folder path.
This checks if the path contains any invalid characters. This also checks if the first part of the path exists. |
![]() ![]() | CheckInvalidCharacters |
Checks if a path contains invalid characters
(according to Path.GetInvalidPathChars).
|
![]() ![]() | Copy |
Creates a copy of an array of bytes.
|
![]() ![]() | CopyDirectory | Copies the content of a directory to another. This is done recursively. |
![]() ![]() | CopyDirectoryContent(String, String) | Copies the content of a directory to another. This is done recursively but the code is not recurcive. All directories are ensured first, then all files are copied. |
![]() ![]() | CopyDirectoryContent(String, String, Boolean) | Copies the content of a directory to another. This is done recursively but the code is not recurcive. All directories are ensured first, then all files are copied. |
![]() ![]() | CopyFileFromStream |
Sets a stream content to a file without affecting the given stream.
(Because the given stream is copied). |
![]() ![]() | CopyStream |
Copies a stream to another stream.
|
![]() ![]() | CopyStreamFromFile |
Gets a stream from a file that will not keep the file locked.
(Because the file stream is copied). |
![]() ![]() | CopyTo |
Copies a file to a new location.
|
![]() ![]() | FilesAreEqual |
Checks if two files are equals.
https://support.microsoft.com/fr-fr/help/320348/how-to-create-a-file-compare-function-in-visual-c
|
![]() ![]() | FilesAreEqual_Hash(FileInfo, FileInfo) |
Checks if two files' content are equal.
|
![]() ![]() | FilesAreEqual_Hash(FileInfo, Stream) |
Checks if two files' content are equal.
|
![]() ![]() | GetAssembliesVersions(ListFileInfo, Boolean) |
Gets all assemblies versions inside a folder.
|
![]() ![]() | GetAssembliesVersions(DirectoryInfo, Boolean, Boolean) |
Gets all assemblies versions inside a folder.
|
![]() ![]() | GetAssembliesVersions(String, Boolean, Boolean) |
Gets all assemblies versions inside a folder.
|
![]() ![]() | GetByteArrayFromStream |
Converts a stream to an array of bytes.
|
![]() ![]() | GetBytes |
Converts a memory stream to an array of bytes.
|
![]() ![]() | GetDestinationPath |
Creates a file path corresponding to the file in the source inside the destination folder.
|
![]() ![]() | GetExtension(FileInfo) |
Gets a file's extension. Uses Path.GetExtension.
|
![]() ![]() | GetExtension(String) |
Gets a file's name extension. Uses Path.GetExtension.
|
![]() ![]() | GetFileContent |
Gets the text content of a file. Currentlty same as System.IO.File.ReadAllText.
|
![]() ![]() | GetMemoryStream(Byte) |
Converts an array of bytes to a memory stream.
|
![]() ![]() | GetMemoryStream(Byte, Boolean) |
Converts an array of bytes to a memory stream.
|
![]() ![]() | GetOfficeExtensions |
Gets all extensions known to be used by an Office application.
|
![]() ![]() | GetWord2010Extensions |
Returns known extensions used for a recent Word file.
|
![]() ![]() | GiveFullControlTo |
Gives all permissions on a file to a user.
|
![]() ![]() | IsImageFile |
Checks if a file name extension is known to be related to an image.
|
![]() ![]() | IsOfficeFile |
Checks if a file name extension is known to be used by an Office application.
|
![]() ![]() | IsWord2010File |
Checks if a file name has a ".docx" or a ".docm" extension.
|
![]() ![]() | ReplaceFileNameInvalidCharacters |
Replaces "Path.GetInvalidFileNameChars" by a given character.
|
![]() ![]() | SaveToFile |
Sets the text content of a file. Currently the same as System.IO.File.WriteAllText.
Uses UTF8 encoding.
|
![]() ![]() | ToFile |
Changes the content of a file to this text. Currently the same as System.IO.File.WriteAllText.
Uses UTF8 encoding.
|
![]() ![]() | ValidateFileName |
Throws exception if not valid. (valid is ****.extension without forbidden characters)
|