Skip to main content

How to make Folder Locker Application in VB.Net


How to make Folder Locker Application in VB

In this article we will see how to make a simple folder locker app in VB.Net. With this folder locker app you will simply able to lock any folder and can able to unlock it later. So let's start.

HOW TO MAKE FOLDER LOCKER APPLICATION IN VB.NET


1) Open Visual Studio. Create new "Windows Form Application". Name it Folder locker or anything you want to name it and click on OK. Change the

2) Now add Label control and give it name.

3) Add 3 Button controls. Change text property of each button as Lock, Unlock and Exit. Change the (Name) property as ButonLock for Lock button, ButtonUnlock for Unlock button and ButtonExit for Exit button.

4) Now add two TextBox controls and place them near the Lock and Unlock button as shown in figure. Change the (Name) property of TextBox1 to txtBrowse and TextBox2 to txtUnBrowse.

5) Now add ProgressBar control and place it as shown in figure.

6) Add FolderBrowserDialog control.

7) Now go to the code section of form. Just Before the form1 class paste the following namespaces.
Imports System.IO
Imports System.Drawing
Imports System.Windows.Forms

8) Now add following code below the form1 class.
Public status As String

    Private arr As String() = New String(5) {}
    Private Sub Folder_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        status = ""
        arr(0) = ".{2559a1f2-21d7-11d4-bdaf-00c04f60b9f0}"
        arr(1) = ".{21EC2020-3AEA-1069-A2DD-08002B30309D}"
        arr(2) = ".{2559a1f4-21d7-11d4-bdaf-00c04f60b9f0}"
        arr(3) = ".{645FF040-5081-101B-9F08-00AA002F954E}"
        arr(4) = ".{2559a1f1-21d7-11d4-bdaf-00c04f60b9f0}"
        arr(5) = ".{7007ACC7-3202-11D1-AAD2-00805FC1270E}"
    End Sub

9) Now go to design view and double click on Lock button to launch event for lock button. Paste the following code within the lock button event.
status = arr(0)

        If FolderBrowserDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
            Dim d As DirectoryInfo = New DirectoryInfo(FolderBrowserDialog1.SelectedPath)
            Dim selectedpath As String = d.Parent.FullName + d.Name

            ProgressBar1.Value = 40

            If FolderBrowserDialog1.SelectedPath.LastIndexOf(".{") = -1 Then
                If (Not d.Root.Equals(d.Parent.FullName)) Then
                    d.MoveTo(d.Parent.FullName & "\" & d.Name & status)
                Else
                    d.MoveTo(d.Parent.FullName + d.Name & status)
                End If

                txtBrowse.Text = FolderBrowserDialog1.SelectedPath
                ProgressBar1.Value = 75
                ProgressBar1.Value = 100
            Else
                status = getstatus(status)
                d.MoveTo(FolderBrowserDialog1.SelectedPath.Substring(0, FolderBrowserDialog1.SelectedPath.LastIndexOf(".")))
                txtBrowse.Text = FolderBrowserDialog1.SelectedPath.Substring(0, FolderBrowserDialog1.SelectedPath.LastIndexOf("."))
            End If
        End If

10) Now copy and paste the following code within Unlock button event.
status = arr(1)

        If FolderBrowserDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
            Dim d As DirectoryInfo = New DirectoryInfo(FolderBrowserDialog1.SelectedPath)
            Dim selectedpath As String = d.Parent.FullName + d.Name

            ProgressBar1.Value = 40
            ProgressBar1.Value = 100

            If FolderBrowserDialog1.SelectedPath.LastIndexOf(".{") = -1 Then
                If (Not d.Root.Equals(d.Parent.FullName)) Then
                    d.MoveTo(d.Parent.FullName & "\" & d.Name & status)
                Else
                    d.MoveTo(d.Parent.FullName + d.Name & status)
                End If

                txtUnBrowse.Text = FolderBrowserDialog1.SelectedPath
                ProgressBar1.Value = 100
                ProgressBar1.Value = 100
            Else
                status = getstatus(status)
                d.MoveTo(FolderBrowserDialog1.SelectedPath.Substring(0, FolderBrowserDialog1.SelectedPath.LastIndexOf(".")))
                txtUnBrowse.Text = FolderBrowserDialog1.SelectedPath.Substring(0, FolderBrowserDialog1.SelectedPath.LastIndexOf("."))
            End If
        End If

11) Now write getstatus function after the Unlock button code.
Private Function getstatus(ByVal stat As String) As String
        For i As Integer = 0 To 5
            If stat.LastIndexOf(arr(i)) <> -1 Then
                stat = stat.Substring(stat.LastIndexOf("."))
            End If
        Next i
        Return stat
    End Function
End Class

12) Copy and paste code below within the Exit button event.
Me.Close()

13) Now compile the application by pressing Ctrl+F5 and test it whether it is works or not.
How to make Folder Locker Application in VBNet


Click here to download Folder Locker Source Code.
Click here to download Folder Locker EXE file.

So that's it guys. Have a fun. Please don't forget to share this post and give us your valuable reply in the comment section below. Thank you!

Comments

  1. Hey, I have a question, can you explain this to me: Public status As String

    Private arr As String() = New String(5) {}
    Private Sub Folder_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    status = ""
    arr(0) = ".{2559a1f2-21d7-11d4-bdaf-00c04f60b9f0}"
    arr(1) = ".{21EC2020-3AEA-1069-A2DD-08002B30309D}"
    arr(2) = ".{2559a1f4-21d7-11d4-bdaf-00c04f60b9f0}"
    arr(3) = ".{645FF040-5081-101B-9F08-00AA002F954E}"
    arr(4) = ".{2559a1f1-21d7-11d4-bdaf-00c04f60b9f0}"
    arr(5) = ".{7007ACC7-3202-11D1-AAD2-00805FC1270E}"
    End Sub
    ---> I don't get it, what's the number for ?

    ReplyDelete

  2. Thanks for sharing, if you want more benefits then remain connect with us.

    Folder Lock Final Crack

    ReplyDelete

Post a Comment

Popular posts from this blog

How to use XBOX 360 Controller Emulator (x360ce) for NFS Rivals and other PC Games

A s we know many of PC Games only supports XBOX 360 controller officially to play the game. If you have local pc gamepad controller then it might not work well with some pc games. So you have to use application called x360ce i.e XBOX 360 Controller Emulator. It emulate your non xbox 360 controller i.e gamepad as xbox 360 controller i.e. force non xbox 360 controller to work as xbox 360 controller. So in this article we will see how to configure x360ce to work with NFS Rivals. HOW TO USE XBOX 360 CONTROLLER EMULATOR (x360ce) 1) Download x360ce and extract xbox360ce.exe in folder where you have installed NFS Rivals. 2) Now open the x360ce.exe from NFS Rivals folder. 3) You will see message like-  'x360ce.ini' was not found. Click on Yes to create ini file. 4) After that you will see the message- 'xinput1_3.dll' was not found. Click on Yes to create it. 5) Next it will detect your controller device. Now select 'Browse my computer for settings'

How to get Android Lollipop Launcher on your Android 4.4 KitKat

As we know Android 5.0 Lollipop is already comes up for Nexus devices and it has got new launcher interfaces. In this article we are going to see how to get Android Lollipop Launcher on your Android device but before going further make sure you are using Android 4.4 KitKat to make this work. This trick has been tested on my Asus Zenfone 5 running on KitKat 4.4.2. So let us start. HOW TO GET ANDROID LOLLIPOP LAUNCHER ON YOU ANDROID KITKAT Download latest Google Play Store (Version 5.0.38). If you have already you can skip this step. You can download it from this link- http://goo.gl/oFn0IW Now download latest version of Google Now Launcher (1.1.1.1516623). If you have already, you can also skip this step. Download it from Play Store- http://goo.gl/4VhGkd Now you have to download Google Search (4.0.26.1499465.arm) designed for Android Lollipop from this link- http://goo.gl/Z9aVou If you got any error like "Unfortunately, Google Search has stopped" then do t