Net Encryption Library
SecureFileErase(String) Method
Example 






KellermanSoftware.NetEncryptionLibrary Namespace > Encryption Class > SecureFileErase Method : SecureFileErase(String) Method
The full path to the file
Securely delete a file by overwriting with random bytes, renaming and then deleting it
Syntax
'Declaration
 
Public Overloads Sub SecureFileErase( _
   ByVal filePath As System.String _
) 
'Usage
 
Dim instance As Encryption
Dim filePath As System.String
 
instance.SecureFileErase(filePath)
public void SecureFileErase( 
   System.string filePath
)
public procedure SecureFileErase( 
    filePath: System.String
); 
public function SecureFileErase( 
   filePath : System.String
);
public: void SecureFileErase( 
   System.string* filePath
) 
public:
void SecureFileErase( 
   System.String^ filePath
) 

Parameters

filePath
The full path to the file
Example
Encryption encryption = new Encryption(); //Trial Mode
//Encryption encryption = new Encryption("place user name here", "place license key here"); //License Mode
 
string testFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "testfile.txt");
File.WriteAllText(testFile, "This is a test");
 
encryption.SecureFileErase(testFile);
 
bool fileExists = File.Exists(testFile);
Console.WriteLine("File Exists: {0}", fileExists);
Dim encryption As New Encryption() 'Trial Mode
'Dim encryption As New Encryption("place user name here", "place license key here") 'License Mode
 
Dim testFile As String = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "testfile.txt")
File.WriteAllText(testFile, "This is a test")
 
encryption.SecureFileErase(testFile)
 
Dim fileExists As Boolean = File.Exists(testFile)
Console.WriteLine("File Exists: {0}", fileExists)
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