Create an password-protected/encrypted folder from within VS
Hi all.
I want to create a protected folder from within VS using a code to securely store a password file. I don't mind hoe it is secured, i just want it to be so that i can't simply go into the folder and open the file. It would be best if it was something short, like:
Code:
Dim password As New System.IO.StreamWriter("C:\Accounts\" + TextBox1.Text + "\" + "password.txt")
password.Write(MaskedTextBox1.Text)
password.Close()
pssword.secure(); 'or something like this.
Re: Create an password-protected/encrypted folder from within VS
no replies? oh come on...
Re: Create an password-protected/encrypted folder from within VS
Yeah, crazy that no one answered in 41 minutes!
First hit on Google gave me something like this:
Code:
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim path As String
Dim fldrName As String
path = "c:\yourPath"
fldrName = "NCripted"
My.Computer.FileSystem.CreateDirectory(path & "\" & fldrName)
My.Computer.FileSystem.GetDirectoryInfo(path & "\" & fldrName).Attributes = IO.FileAttributes.Encrypted
End Sub
Re: Create an password-protected/encrypted folder from within VS
Quote:
Originally Posted by
vbfbryce
Yeah, crazy that no one answered in 41 minutes!
First hit on Google gave me something like this:
Code:
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim path As String
Dim fldrName As String
path = "c:\yourPath"
fldrName = "NCripted"
My.Computer.FileSystem.CreateDirectory(path & "\" & fldrName)
My.Computer.FileSystem.GetDirectoryInfo(path & "\" & fldrName).Attributes = IO.FileAttributes.Encrypted
End Sub
Ok, will this make the folder unaccessible for the user, but not the program?