|
-
Nov 14th, 2000, 03:38 AM
#1
Thread Starter
Frenzied Member
I want to Hide/Unhide a File Folder with one button click.
Any ideas?
Maybe later I want to password protect folder/file access also.
-
Nov 14th, 2000, 03:54 AM
#2
Member
You can just manipulate the files attributes to hidden.
I like to protect my folders by running a program I wrote. The program watches the names of open windows and when it finds a match with one I have selected, it close it. i.e. I tell my program to watch for "new folder". When "new folder" or any program named that is opened, my program closes that window.
-
Nov 14th, 2000, 03:57 AM
#3
Member
There is a problem with using the method mentioned above. If you tell the program to watch for "new folder", then anyone can rename the folder to "new folder2" and then open it. In order to safeguard against this, you must write a function that compares the names and finds any close matches.
-
Oct 11th, 2009, 08:15 PM
#4
New Member
Hide/Unhide File Folder
Dim Dir = "C:\A\"
'Hides All The Files (Not SubFolders)
Dim DirInfo As New IO.DirectoryInfo(Dir)
Dim Files As IO.FileInfo() = DirInfo.GetFiles
Dim FileName As IO.FileInfo
For Each FileName In Files
SetAttr(Dir & FileName.ToString, FileAttribute.Hidden)
Next
'Hides The Folder
SetAttr(Dir, FileAttribute.Hidden)
'Visual Basic 2008 Tested
Last edited by §AE§; Oct 11th, 2009 at 08:19 PM.
-
Oct 11th, 2009, 09:21 PM
#5
Re: Hide/Unhide File Folder
'Visual Basic 2008 Tested
this is a vb6 forum
vb Code:
SetAttr "c:\temp\abc\", vbHidden
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Oct 11th, 2009, 10:25 PM
#6
New Member
Re: Hide/Unhide File Folder
My bad, just trying to help
-
Oct 12th, 2009, 08:17 AM
#7
Thread Starter
Frenzied Member
Re: Hide/Unhide File Folder
No offense, but if it had taken me 9 years to get this I would've found a new line of work 
Or just gone to a real language like C#
(flames begin) lol
-
Oct 12th, 2009, 10:30 AM
#8
New Member
Re: Hide/Unhide File Folder
I never pay attention to the dates because people take a look at these all time. Its a great thing to leave useful code on the internet for other people to copy. Especially if they understand the code and better themselves as a programmer
Even if I post it in the wrong category
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
|