System Class has a lot of Functions
like
Selecting a file and Folder,
Writing result in console,
Popping up Message,
ETC.....
I brought it from EnCase Help page.
########################### Code and Result ###########################
Black : Code
Red : Result
######################################################################
class MainClass;
class MainClass {
void Main(CaseClass c) {
String path;
int i;
bool pluginExist;
path = "C:\\";
//ClearConsole()
SystemClass::ClearConsole(); // clears the console
//Message()
SystemClass::Message(SystemClass::ICONINFORMATION, "Message Example", "You are in the SystemClass Example");
//ScriptPath()
Console.WriteLine("The path of the script is " +SystemClass::ScriptPath()); // return full path of script
The path of the script is C:\Users\dorumugs\Desktop\dorumugs\mytest_1.EnScript
//Random()
Console.WriteLine("The random number generated was "+SystemClass::Random(300)); // returns a random integer
The random number generated was 96
//FolderDialog()
SystemClass::FolderDialog(path, "FolderDialog Example :: Choose a Folder");//FolderDialog can be used to select a folder
Console.WriteLine("Folder that was selected from FolderDialog is "+path);
path.Close(); // setting path to an empty string\
Folder that was selected from FolderDialog is C:\CASES
//PathDialog()
//PathDialog can be used with SystemClass::OPEN to open an existing file or SystemClass::CREATE to create a new file
SystemClass::PathDialog(path, "PathDialog Example :: Choose a File", "doc","TextFiles\0*.txt\0Word Document\0*.doc", SystemClass::OPEN);
Console.WriteLine("File that was selected from PathDialog is "+path);
File that was selected from PathDialog is C:\Program Files\EnCase7\winen.txt
//StatusRange()
SystemClass::StatusRange("Example Status Range", 20000000); //bottom right corner status blinks with "Example Status Range"
//StatusInc()
SystemClass::StatusMessage("Example Status Message"); //sets the status message for the StatusInc
for (i = 0; i < 20000000; i++)
SystemClass::StatusInc(1); //bottom right corner status blinks with Enscript name if the StatusMessage is not set
//PluginInstalled()
pluginExist = SystemClass::PluginInstalled(SystemClass::FBSE); // the option can be changed to any option in SystemClass::PluginTypes
if (pluginExist) //and Encase can be tested to see if that Plugin is installed
Console.WriteLine("Plugin Type FBSE is installed");
else
Console.WriteLine("Plugin Type FBSE is not installed");
Plugin Type FBSE is installed
//MajorVersion()
Console.WriteLine("Major Version of Encase = "+SystemClass::MajorVersion());
Major Version of Encase = 7
//MinorVersion()
Console.WriteLine("Minor Version of Encase = "+SystemClass::MinorVersion());
Minor Version of Encase = 5
//SubMinorVersion()
Console.WriteLine("Sub Minor Version of Encase = "+SystemClass::SubMinorVersion());
Sub Minor Version of Encase = 219
}
}
No comments:
Post a Comment