Class LocalShell
Allows in/out operations and/or data validations with a local computer.
Implements
Inherited Members
Namespace: AutoCheck.Core.Connectors
Assembly: AutoCheck.dll
Syntax
public class LocalShell : Connector, IDisposable
Constructors
| Improve this Doc View SourceLocalShell()
Creates a new connector instance.
Declaration
public LocalShell()
Properties
| Improve this Doc View SourceShell
The shell client used to send local commands.
Declaration
public ShellConfigurator Shell { get; }
Property Value
Type | Description |
---|---|
ToolBox.Bridge.ShellConfigurator |
Methods
| Improve this Doc View SourceCountFiles(String, Boolean)
Returns how many files has been found within the given path.
Declaration
public virtual int CountFiles(string path, bool recursive = true)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | Path where the files will be searched into. |
System.Boolean | recursive | Recursive deep search. |
Returns
Type | Description |
---|---|
System.Int32 | The amount of files. |
CountFolders(String, Boolean)
Returns how many folders has been found within the given path.
Declaration
public virtual int CountFolders(string path, bool recursive = true)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | Path where the folders will be searched into. |
System.Boolean | recursive | Recursive deep search. |
Returns
Type | Description |
---|---|
System.Int32 | The amount of folders. |
Dispose()
Disposes the object releasing its unmanaged properties.
Declaration
public override void Dispose()
Overrides
GetFile(String, String, Boolean)
Returns a file full path if exists.
Declaration
public virtual string GetFile(string path, string file, bool recursive = true)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | Path where the file will be searched into. |
System.String | file | The file to search. |
System.Boolean | recursive | Recursive deep search. |
Returns
Type | Description |
---|---|
System.String | Folder's full path, NULL if does not exists. |
GetFolder(String, String, Boolean)
Returns a folder full path if exists.
Declaration
public virtual string GetFolder(string path, string folder, bool recursive = true)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | Path where the folder will be searched into. |
System.String | folder | The folder to search. |
System.Boolean | recursive | Recursive deep search. |
Returns
Type | Description |
---|---|
System.String | Folder's full path, NULL if does not exists. |
RunCommand(String, String)
Runs a local shell command.
Declaration
public virtual (int code, string response) RunCommand(string command, string path = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | command | The command to run. |
System.String | path | The binary path where the command executable is located. |
Returns
Type | Description |
---|---|
System.ValueTuple<System.Int32, System.String> | The return code (0 = OK) and the complete response. |