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
Printable View
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
i think if you need this urgently answered then you should be more specific...
You just have to write a pass word i think to a dat file.
That will lock the folder, it uses a password and username. Almost done with UnlockingCode: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
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
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.