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