Net Encryption Library
SecureDirectoryErase(String) Method
Example 






KellermanSoftware.NetEncryptionLibrary Namespace > Encryption Class > SecureDirectoryErase Method : SecureDirectoryErase(String) Method
The directory to erase
Securely erase all files and sub directories within a directory
Syntax
'Declaration
 
Public Overloads Sub SecureDirectoryErase( _
   ByVal directoryPath As System.String _
) 
'Usage
 
Dim instance As Encryption
Dim directoryPath As System.String
 
instance.SecureDirectoryErase(directoryPath)
public void SecureDirectoryErase( 
   System.string directoryPath
)
public procedure SecureDirectoryErase( 
    directoryPath: System.String
); 
public function SecureDirectoryErase( 
   directoryPath : System.String
);
public: void SecureDirectoryErase( 
   System.string* directoryPath
) 
public:
void SecureDirectoryErase( 
   System.String^ directoryPath
) 

Parameters

directoryPath
The directory to erase
Example
Encryption encryption = new Encryption(); //Trial Mode
//Encryption encryption = new Encryption("place user name here", "place license key here"); //License Mode
 
string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TestDirectory");
Directory.CreateDirectory(path);
 
string testFile = Path.Combine(path, "testfile.txt");
File.WriteAllText(testFile,"This is a test");
 
encryption.SecureDirectoryErase(path);
 
bool directoryExists = Directory.Exists(path);
Console.WriteLine("Directory Exists: {0}", directoryExists);
Dim encryption As New Encryption() 'Trial Mode
'Dim encryption As New Encryption("place user name here", "place license key here") 'License Mode
 
Dim path As String = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TestDirectory")
Directory.CreateDirectory(path)
 
Dim testFile As String = Path.Combine(path, "testfile.txt")
File.WriteAllText(testFile,"This is a test")
 
encryption.SecureDirectoryErase(path)
 
Dim directoryExists As Boolean = Directory.Exists(path)
Console.WriteLine("Directory Exists: {0}", directoryExists)
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

Encryption Class
Encryption Members
Overload List