Results 1 to 11 of 11

Thread: how to protect folder, files & application by password using VB

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2002
    Posts
    83

    Unhappy how to protect folder, files & application by password using VB

    Hi all,

    i want to protect folder, files & application by password using VB can anydody help me how to do this.

    pradip
    Pradip Adhikari

  2. #2
    Banned Michael_Kamen's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,180
    So you want to have a password form popup whenever the user wants to open a file or directory, or specified files? That's gonna be hard.
    I think someone else asked this a few weeks ago. Try searching these forums for that tread, and see what solutions were provided.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2002
    Posts
    83

    pls. help me

    Hi

    I am not getting reply from any one about that could u pls help me.
    Pradip Adhikari

  4. #4
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    See if this helps you:
    VB Code:
    1. Private Const FILE_NOTIFY_CHANGE_ATTRIBUTES = &H4
    2. Private Const FILE_NOTIFY_CHANGE_DIR_NAME = &H2
    3. Private Const FILE_NOTIFY_CHANGE_FILE_NAME = &H1
    4. Private Const FILE_NOTIFY_CHANGE_SIZE = &H8
    5. Private Const FILE_NOTIFY_CHANGE_LAST_WRITE = &H10
    6. Private Const FILE_NOTIFY_CHANGE_SECURITY = &H100
    7. Private Const FILE_NOTIFY_CHANGE_ALL = &H4 Or &H2 Or &H1 Or &H8 Or &H10 Or &H100
    8. Private Declare Function FindFirstChangeNotification Lib "kernel32" Alias "FindFirstChangeNotificationA" (ByVal lpPathName As String, ByVal bWatchSubtree As Long, ByVal dwNotifyFilter As Long) As Long
    9. Private Declare Function FindCloseChangeNotification Lib "kernel32" (ByVal hChangeHandle As Long) As Long
    10. Private Declare Function FindNextChangeNotification Lib "kernel32" (ByVal hChangeHandle As Long) As Long
    11. Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
    12. Private Declare Function ResetEvent Lib "kernel32" (ByVal hEvent As Long) As Long
    13. Private Sub Form_Load()
    14.     'KPD-Team 2000
    15.     'URL: [url]http://www.allapi.net/[/url]
    16.     'E-Mail: [email][email protected][/email]
    17.     Dim Ret As Long
    18.     'Set the notification hook
    19.     Ret = FindFirstChangeNotification("C:\", &HFFFFFFFF, FILE_NOTIFY_CHANGE_ALL)
    20.     'Wait until the event is triggered
    21.     WaitForSingleObject Ret, &HFFFFFFFF
    22.     Debug.Print "Event Triggered for the first time"
    23.     Beep
    24.     'Reactivate our hook
    25.     FindNextChangeNotification Ret
    26.     'Wait until the event is triggered
    27.     WaitForSingleObject Ret, &HFFFFFFFF
    28.     Debug.Print "Event Triggered for the second time"
    29.     Beep
    30.     'Remove our hook
    31.     FindCloseChangeNotification Ret
    32.    
    33. End Sub

  5. #5
    Member
    Join Date
    Oct 2002
    Location
    India
    Posts
    35
    I have a program with that you can lock unlock any folder.
    If you wnat I can mail it to you.
    Jyotiraditya Rath
    http://myvbhome.tripod.com

  6. #6
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089
    I have a program with that you can lock unlock any folder.
    If you wnat I can mail it to you.
    do you have the source code of it as well??

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jul 2002
    Posts
    83

    Red face pls. send me

    hi jyotiraditya,

    could u pls. send me the application.

    pradip
    Pradip Adhikari

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Jul 2002
    Posts
    83

    Thumbs up thanks for thr app.

    hi jyotiraditya,

    thank's for sending me a nice app. & it is working fine in my pc. i think i know the logic of the app. & this will not serve my purpose.

    because here the app. is changing the directory type to a shortcut file & renaming it with some algo.

    in this way i can't protect my system or program files directory. but i want to protect the system directory from dos prompt as well as network.

    if u can help me i will be thank full to u.

    pradip
    Pradip Adhikari

  9. #9
    Member
    Join Date
    Dec 2002
    Location
    US
    Posts
    46
    This won't work for a folder but you could encrypt the file that you want to protect, and open the file in your own program that asks for the password then decrypts the file

  10. #10
    Fanatic Member seec77's Avatar
    Join Date
    Jan 2003
    Posts
    596
    you can make a special encrypted file with all the files in a folder and then make a link to your program with the parameters of the file and then your program asks for the password and if it's ok the program will browse the encrypted file!
    Best Regards,
    seec77

    If you helped me, cosinder yourself thanked.

    Get each and every Garfield strip here!
    Here you can get all Calvin & Hobes strips!
    Damn UComics! It was probably unprofitable for them to allow us to just download Garfield and Calving & Hobes strips... so they made folder indexing unallowed on their server!!!

    I am 33% addicted to Counterstrike. What about you?
    I am 23% addicted to Star Wars. What about you?
    I am 0% addicted to Tupac. What about you?

  11. #11
    Member
    Join Date
    Feb 2003
    Location
    New Delhi, India
    Posts
    63

    Lightbulb

    Hi apradip,

    I do not if this could help you...

    dim a as string

    a= "c:\xyz\pwq"

    mkdir(a)
    call setattr(a,vbSystem + vbHidden)

    '// hope this helps

    take care,
    Harold Bright
    Failures are divided into two classes --
    those who thought and never did, and those who did and never thought.
    - John Charles Salak

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