Saturday, October 22, 2011

Cara Membuat Software Pengunci Folder Dengan VB.Net


Cara Membuat Software Pengunci Folder Dengan VB.Net

            Pertama anda harus membuat Form seperti gambar dibawah ini :

 
Toolbox yang diperlukan adalah :
 

1 textbox
3 button . button 1 = browser , button 2 = lock , button 3 = unlock
1 folderbrowserdialog

Double Click Form anda , lalu dibagian paling atas tempat code/general masukan :
Imports System.Security.AccessControl
Imports System.IO

Double Click Pada Button Browse lalu masukan :
        With FolderBrowserDialog1
            If .ShowDialog() = DialogResult.OK Then
                TextBox1.Text = .SelectedPath
            End If
        End With
Double Click Pada Button Lock lalu masukan :
Dim fs As FileSystemSecurity = File.GetAccessControl(TextBox1.Text)
    fs.AddAccessRule(New FileSystemAccessRule(Environment.UserName, FileSystemRights.FullControl, AccessControlType.Deny))
    File.SetAccessControl(TextBox1.Text, fs)
msgbox(“folder telah dikunci”)

Double Click Pada Button Unlock lalu masukan :
    Dim fs As FileSystemSecurity = File.GetAccessControl(TextBox1.Text)
    fs.RemoveAccessRule(New FileSystemAccessRule(Environment.UserName, FileSystemRights.FullControl, AccessControlType.Deny))
    File.SetAccessControl(TextBox1.Text, fs)
msgbox(“folder telah dibuka”)

Jadi syntax code fullnya seperti dibawah ini :
Synra Folder Locker v1.0
Imports System.Security.AccessControl
Imports System.IO


Private Sub btnBrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBrowse.Click


        With FolderBrowserDialog1
            If .ShowDialog() = DialogResult.OK Then
                TextBox1.Text = .SelectedPath
            End If
        End With


End Sub


Private Sub btnLock_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLock.Click
    Dim fs As FileSystemSecurity = File.GetAccessControl(TextBox1.Text)
    fs.AddAccessRule(New FileSystemAccessRule(Environment.UserName, FileSystemRights.FullControl, AccessControlType.Deny))
    File.SetAccessControl(TextBox1.Text, fs)
msgbox(“folder telah dikunci”)

End Sub


Private Sub btnUnLock_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUnLock.Click

    Dim fs As FileSystemSecurity = File.GetAccessControl(TextBox1.Text)
    fs.RemoveAccessRule(New FileSystemAccessRule(Environment.UserName, FileSystemRights.FullControl, AccessControlType.Deny))
    File.SetAccessControl(TextBox1.Text, fs)
msgbox(“folder telah dibuka”)
End Sub


Selamat Mencoba Semoga Berhasil :)
Jangan lupa didalam program buatan anda di Thanks And Creditnya nanti masukan nama saya dan alamat situs ini. Terimakasih .

Download ebook Cara Membuat Software Pengunci Folder Dengan VB.Net(.pdf):Clickhere

Thanks And Credit :
My Lovely Mother With His Miracle Prayer
Bapak Ir.Erwan Yani,M.M , Sebagai Master Digital Grafis Designer
Bapak Drs. Aswan , M.Si sebagai Technocrat Leader , Instructor & Marketing
Bapak Adhika Eko, S.Kom sebagai Instructor dan Multimedia Mastering
Bapak Cecep Furqon, S.T. Sebagai Master Programming.
All Synra Team

Visit us :
www.synra.blogspot.com
www.amik-garut.blogspot.com
www.amikgarut.blogspot.com
www.garut-hacker.blogspot.com

Labels: