Mega Code Archive

 
Categories / VB.Net / File Directory
 

FileInfo Decrypt decrypts a file that was encrypted using the Encrypt method

Imports System Imports System.IO Imports System.Security.AccessControl Module FileExample     Sub Main()             Dim FileName As String = "c:\MyTest.txt"             AddEncryption(FileName)             RemoveEncryption(FileName)     End Sub     Sub AddEncryption(ByVal FileName As String)         Dim fInfo As New FileInfo(FileName)         If fInfo.Exists = False Then             fInfo.Create()         End If         fInfo.Encrypt()     End Sub     Sub RemoveEncryption(ByVal FileName As String)         Dim fInfo As New FileInfo(FileName)         If fInfo.Exists = False Then             fInfo.Create()         End If         fInfo.Decrypt()     End Sub End Module