Results 1 to 6 of 6

Thread: lock and unlock folder ..(quite urgent)..

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2006
    Posts
    109

    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

  2. #2
    Lively Member se7en's Avatar
    Join Date
    Dec 2006
    Location
    Manchester, UK
    Posts
    118

    Re: lock and unlock folder ..(quite urgent)..

    i think if you need this urgently answered then you should be more specific...

    Did a reply help answer your questions? Please RATE good posts!
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    New Laptop System: Intel Dual-Core T2060 2.0GHz • 533MHz FSB • 2MB Cache • 1024MB RAM • 120GB Hard Drive • Dual Layer DVD ReWriter MultiDrive • 15.4" Widescreen Display • Microsoft Windows Vista Ultimate • 128MB Intel GMA 900 UMA Graphics

  3. #3
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: lock and unlock folder ..(quite urgent)..

    You just have to write a pass word i think to a dat file.

  4. #4
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    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.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Dec 2006
    Posts
    109

    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

  6. #6
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    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
  •  



Click Here to Expand Forum to Full Width