-
Notifications
You must be signed in to change notification settings - Fork 0
Helpers.SystemOperations
This subclass contains the Files subclass and Folders subclass.
This method will delete any duplicate files in the specified folder that contain an unique identifier.
Mandatory Parameters | Optional Parameters |
---|---|
string folderPath |
string duplicateIdentifier (default "(") |
Example:
Helpers.SystemOperations.DeleteDuplicateFiles("C:\Users\my.user\Desktop\Logs\");
This method will delete the file at the specified path.
Mandatory Parameters |
---|
string filePath |
Example:
Helpers.SystemOperations.DeleteFile("C:\Users\my.user\Desktop\Logs\myFile.txt");
This method will create a folder at the specified path.
Mandatory Parameters |
---|
string folderPath |
Example:
Helpers.SystemOperations.CreateFolder("C:\Users\my.user\Desktop\Logs\NewFolder");
This method will move a file from a path to another path, optionally renaming the file.
Warning: If the folder you try to move the file to does not exist, this method will throw an Exception.
Mandatory Parameters |
---|
string filePath |
string directoryPath |
Example:
Helpers.SystemOperations.MoveFile("C:\Users\my.user\Desktop\Logs\myFile.txt", "C:\Users\my.user\Desktop\myNewFile.txt");
This method will rename a file at the given path.
Mandatory Parameters |
---|
string filePath |
string newName |
Example:
Helpers.SystemOperations.RenameFile("C:\Users\my.user\Desktop\Logs\myFile.txt", "MyNewFile.txt");
This method will move a collection of files from a given path.
Mandatory Parameters |
---|
List<string> files |
string folderPath |
string directoryPath |
Example:
Helpers.SystemOperations.MoveFiles(ListOfFileNames,"C:\Users\my.user\Desktop\Logs\", "C:\Users\my.user\Desktop\Desktop\");
This method will verify if a specified path contains any files.
Mandatory Parameters |
---|
string folderPath |
Example:
Helpers.SystemOperations.FolderContainsFiles("C:\Users\my.user\Desktop\Desktop\");
This method will create a folder at the specified path.
Mandatory Parameters |
---|
string path |
Example:
Helpers.SystemOperations.CreateFolder("C:\Users\my.user\Desktop\Desktop\NewFolder");
This method will delete a folder at the specified path.
Mandatory Parameters |
---|
string folderPath |
Example:
Helpers.SystemOperations.DeleteFolder("C:\Users\my.user\Desktop\Desktop\NewFolder");
This method will archive a folder at the specified path then move it to a specified path.
Mandatory Parameters |
---|
string folderPath |
string otherPath |
Example:
Helpers.SystemOperations.ArchiveFolder("C:\Users\my.user\Desktop\Desktop\NewFolder", "C:\Users\my.user\Desktop\Desktop");