Results 1 to 7 of 7

Thread: Remembering user inputs?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 1999
    Posts
    93
    How can I make my program remember data the user enters. I want my user to be able to back up their favorite folders by only entering the path in once.

    I know I could use a textbox with the string for the path, or a directory tree. But I can't figure out how to keep the user from having to enter this in every time.

    What my program will do is back up the folders to disk with only one click, without the user having to find all of the folders each time, or entering in the backup destination.

    Thanks
    Brandon

  2. #2
    Guest
    I don't understand what you're trying to do here, create a program that will backup (copy??? or just put shortcuts) a folder that the user access more (or it's his/her's fav)... and you want to do what??? Here's what I'm thinking, your program copies A WHOLE FOLDER that the user clicks onces, and copies it to a new destination where the program can access it quicker?

    You can write to a text file, the names of the folder and stuff like that, and then have the program access the file again and read from it what user chose.. that way it'll remember, ok I hope this helps, but seriously I don't get what you're trying to do, if you can explain your program a lil' better we might be able to help you...

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 1999
    Posts
    93
    That's exactly what I wanted to know, but I'll explain anyway.

    The user starts the program and enters in what folders they want to backup on a usual basis. From then on all they have to do is start the program and press backup.

    Thanks
    BJ

  4. #4
    Member
    Join Date
    Mar 2000
    Posts
    32
    It sounds as though you are only interested in saving the path to the directories they want to back up. What you could do is use the registry and call the function:

    SaveSetting appname, section, key, setting

    where appname is your appname, section is the folder you registry section you want it in ex. Backup. Key would be the key name ex. Path1. The setting would be the actual path. Then you could use the GetAllSettings function to return an array of all the settings.

    If you need more help or more specifics let me know.

  5. #5
    Hyperactive Member
    Join Date
    Mar 2000
    Posts
    461
    I think what you need is to store the Path they enter into the registry and retrieve it when they start the program the next time.

    To Retrieve what they previous wrote you use :

    Code:
    TextBox1.Text = GetSetting(App.Title,"Default","Path")
    And to set it you use :

    Code:
    SaveSetting(App.Title,"Default","Path",TextBox1.Text)
    Now go have a look in the registry (using regedit) under HKEY_CURRENT_USER\Software\VB and VBA Program Settings\YourAppName\Default\Path


    You should find it has saved what you wanted.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Sep 1999
    Posts
    93
    In this code is the app.title defined or can I name it anything as long as I use the same name to retrieve it.

    Thanks
    BJ

  7. #7
    Guest
    Well App.Title would be a key (Registry folder) in your registry, so yea sure why not, you can make it "my app" or whatever you want to, but if you put App.Title, then it'll make a key named the "title of your application".... I think the app.title way is better, that way you don't have to worry about anything, nore remembering the name that you created the key as.... but the final answer is yes, you can change it, and you don't have to use app.title in there..

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