|
-
Aug 1st, 2007, 08:12 PM
#1
Thread Starter
Lively Member
lock and unlock folder ..(quite urgent)..
Hi friends,
In my visulabasic project , i need to lock and unlock one folder , how to do this one??
any idea??
advance thanks for your help..
waiting for your valuable information..
with regards,
kar
-
Aug 1st, 2007, 08:35 PM
#2
Lively Member
-
Aug 1st, 2007, 10:08 PM
#3
Re: lock and unlock folder ..(quite urgent)..
You just have to write a pass word i think to a dat file.
-
Aug 1st, 2007, 10:24 PM
#4
Re: lock and unlock folder ..(quite urgent)..
Code:
Const AlterExtn = ".{f39a0dc0-9cc8-11d0-a599-00c04fd64433}"
Public Function LockFolder(sFolder As String, sUser As String, sPass As String)
Dim F As Integer
F = FreeFile
If InStr(1, sFolder, ".", vbTextCompare) = 0 Then
If sUser <> vbNullString And sPass <> vbNullString Then
Open sFolder & "\Protect.dat" For Output As #F
Print #F, sUser
Print #F, sPass
Close #F
Name sFolder As sFolder & AlterExtn
Else
MsgBox "Folder is already locked"
End If
End If
End Function
That will lock the folder, it uses a password and username. Almost done with Unlocking
Last edited by Paul M; Aug 1st, 2007 at 11:03 PM.
-
Aug 2nd, 2007, 01:19 AM
#5
Thread Starter
Lively Member
Re: lock and unlock folder ..(quite urgent)..
Hi All,
Thanks for your quick reply..
i have some doubt
using this function does it affect the folder??
i hope it never affect the folder.. right??
and after i lock the folder , may be my application corruped or some other reason , which make not to use this appliaction.
in this situation how to unlock the folder with out using vb??
waiting for your valuable reply..
with regards,
kar
-
Aug 2nd, 2007, 01:22 AM
#6
Re: lock and unlock folder ..(quite urgent)..
There shouldn't be any problems. For some reason its not unlocking it >.< i will try and see if there is a more efficient method using API.
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
|