/// <summary>

/// Checks if all files needed exists

/// </summary>

private void RequiredFilesExistCheck ( )

{

//Required files needed to run program

string [ ] requiredFiles =

{

"test.jpg" ,

"test1.jpg"

} ;

//Stores files in directory

List < string > filesInDirectory = new List < string > { } ;

//Directory path of where files are stored

string directoryPath = @"C:\Users\" + username + @"\AppData\Local\Temp\NGStatEditor" ;

//Gets all files in the directory

var getFiles = System. IO . Directory . GetFiles ( directoryPath ) ;

//Gets files in directory

foreach ( var myFiles in getFiles )

{

//Gets file names from array

foreach ( var myRequiredFiles in requiredFiles )

{

//Removes directory path, only keeps file name

var files = myFiles . Remove ( 0 , directoryPath . Length + 1 ) ;

//Add files in directory to list

filesInDirectory . Add ( files ) ;

}

}

//Compares requiredFiles and filesInDirectory to check if all files needed exist

if ( requiredFiles . All ( filesInDirectory . Contains ) )

{

MessageBox . Show ( "True" ) ;

userHasFiles = true ;

filesInDirectory . Clear ( ) ;

}

else

{

MessageBox . Show ( "False" ) ;

userHasFiles = false ;

}

}

}