Files hiding application
Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
1 post
Page 1 of 1
Hello, i will try to explain how to hide files using VB. Heres what you need to add:
5 buttons,
2 listboxes
1 textbox
1 openfiledialog
1 savefiledialog
1 folderbrowsingdialog
Now rename whatever button to "hide file", double click it and paste this code:
Rename other button to "hide folder" and add this code:
Now rename other button to "dehide" or something and add this code:
Rename other button to "dehide from url" and add this code:
And the last button. Make it "save list" and add code:
Make the listbox1 visible = false or hide off the program borders and make listbox2 visible.
Make listbox2 event _click and add this code:
5 buttons,
2 listboxes
1 textbox
1 openfiledialog
1 savefiledialog
1 folderbrowsingdialog
Now rename whatever button to "hide file", double click it and paste this code:
Code: Select all
This will hide your selected file and adds info about it in listbox. Try
OpenFileDialog1.ShowDialog()
For Each file In OpenFileDialog1.FileNames
ListBox1.Items.Add(file)
ListBox2.Items.Add(System.IO.Path.GetFileName(file))
Next
Dim ToHideDir As New System.IO.DirectoryInfo(OpenFileDialog1.FileName)
ToHideDir.Attributes = IO.FileAttributes.Hidden
MsgBox("File has been hidded!", MsgBoxStyle.Information, "Hider")
Catch ex As Exception
End Try
Rename other button to "hide folder" and add this code:
Code: Select all
This also hides your folder and adds folder name to listbox. Try
FolderBrowserDialog1.ShowDialog()
ListBox1.Items.Add(FolderBrowserDialog1.SelectedPath.Trim())
ListBox2.Items.Add(System.IO.Path.GetFileName(FolderBrowserDialog1.SelectedPath.Trim))
Dim ToHideDir As New System.IO.DirectoryInfo(FolderBrowserDialog1.SelectedPath.Trim)
ToHideDir.Attributes = IO.FileAttributes.Hidden
MsgBox("File has been hidded!", MsgBoxStyle.Information, "Hider")
Catch ex As Exception
End Try
Now rename other button to "dehide" or something and add this code:
Code: Select all
This will restores your selected item in listbox. Try
Dim ToHide As New System.IO.DirectoryInfo(ListBox1.SelectedItem)
ToHide.Attributes = IO.FileAttributes.Normal
ListBox1.Items.Remove(ListBox1.SelectedItem)
ListBox2.Items.Remove(ListBox2.SelectedItem)
MsgBox("File restored!", MsgBoxStyle.Information, "Hider")
Catch ex As Exception
End Try
Rename other button to "dehide from url" and add this code:
Code: Select all
This restores your hidden file by writing url in textbox. Try
Dim ToHideDir As New System.IO.DirectoryInfo(TextBox1.Text)
ToHideDir.Attributes = IO.FileAttributes.Normal
MsgBox("File restored!", MsgBoxStyle.Information, "Hider")
Catch ex As Exception
End Try
And the last button. Make it "save list" and add code:
Code: Select all
It will make text file with your hidden files url's, so you will never forget what have you been hid. Try
SaveFileDialog1.ShowDialog()
Dim w As New IO.StreamWriter(SaveFileDialog1.FileName)
Dim i As Integer
For i = 0 To ListBox1.Items.Count - 1
w.WriteLine(ListBox1.Items.Item(i))
Next
w.Close()
Catch ex As Exception
End Try
Make the listbox1 visible = false or hide off the program borders and make listbox2 visible.
Make listbox2 event _click and add this code:
Code: Select all
Add another listbox2 event _SelectedIndexChanged and add this code:
Try
ListBox1.SelectedIndex = ListBox2.SelectedIndex
Catch ex As Exception
End Try
Code: Select all
And it should be working. Sorry if something similar was there. Also you can download the whole project here.
On Error Resume Next
ListBox1.SelectedIndex = ListBox1.SelectedIndex
1 post
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023