Results 1 to 4 of 4

Thread: Create an password-protected/encrypted folder from within VS

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2015
    Posts
    16

    Exclamation 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.

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Jun 2015
    Posts
    16

    Re: Create an password-protected/encrypted folder from within VS

    no replies? oh come on...

  3. #3
    PowerPoster
    Join Date
    Oct 2008
    Location
    Midwest Region, United States
    Posts
    3,574

    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

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jun 2015
    Posts
    16

    Re: Create an password-protected/encrypted folder from within VS

    Quote Originally Posted by vbfbryce View Post
    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
  •  



Click Here to Expand Forum to Full Width