|
-
Jun 18th, 2015, 01:01 PM
#1
Thread Starter
Junior Member
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.
-
Jun 18th, 2015, 01:42 PM
#2
Thread Starter
Junior Member
Re: Create an password-protected/encrypted folder from within VS
no replies? oh come on...
-
Jun 18th, 2015, 02:05 PM
#3
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
-
Jun 18th, 2015, 02:23 PM
#4
Thread Starter
Junior Member
Re: Create an password-protected/encrypted folder from within VS
 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?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|