Saving User Settings

ok, so far my app allows people to choose a prog to add to the menu, however, closing an opening the prog resets everythin, how do i save


Answer this question

Saving User Settings

  • bjpohl

    what about .data how do i use that

  • Phillipe

    im sorry, but im already lost :(

    Maybe u could make a quick app for me to learn off i dont know, im finding this very confusing

  • mwong7025

  • charlie.b

    Check out http://msdn.microsoft.com/library/default.asp url=/library/en-us/dnvs05/html/vbmysettings.asp

    You could create a user-scoped setting of type StringCollection, and add the path to the program there when the user adds the menu item.

    When starting the program, loop thorough all the items in the collection and add it as a corrsponding menu item.

    Just make sure that you save your settings when you close the application (either by calling My.Settings.Save or, if you are using the application framework in, the "Save my settings" checkbox is checked on the Application property page)

    Best regards,
    Johan Stenberg

  • Anoop.k

    iim sorry, but that made no sense to be... Could you help me out

    Thankx

  • Robert Rouse

    so far this is how my app works:

    People add a program to the menu using openfiledialog, thats fine

    once they choose a program in openfiledialog, the filepath appears in textbox1, the menu item has the following code in it:


    process.star (textbox1.text)
     


    so it reads the filepath in textbox1 and then initiates the program

    A friend told me that u then had to put this into the form1_load:


    Dim app_path As String

     

    Dim nFilenum As Integer

     

    nFilenum = FreeFile()

    app_path = My.Application.Info.DirectoryPath

    FileOpen(nFileNum, app_path & "\" & "SortingApp.data", OpenMode.Binary, OpenAccess.Read, OpenShare.LockReadWrite)


     



    i did that and their were no errors

    Now when i add a program to the menu a .data file appears in the directory that my app is located, it opens as a notepad

    now on her program a filepath gets added to the notepad, how come mine doesnt

    and also how would i make the textbox1 read the file and display it when i start up my app

    Thankx for any replies :)



  • turbofart

    Isnt there something easier it doesnt have to be secure in anyway, its not passwords or anything, they just add a program to the menu, i just need it to stay there :)

  • Regerio R. Alcantara

    Hi,

    to store your application settings in .net the app.config xml-file is used. The articles describe how to write and read data from that files.

    Of course you can use the windows regestry or other types of files, too.



  • Saving User Settings