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)
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 :)
Saving User Settings
bjpohl
Phillipe
Maybe u could make a quick app for me to learn off i dont know, im finding this very confusing
mwong7025
use the app.config xml-file to do so:
http://msdn.microsoft.com/library/default.asp url=/library/en-us/vbcon/html/vboriintroductiontoapplicationsettingstorage.asp
http://msdn.microsoft.com/msdnmag/issues/05/04/AdvancedBasics/
charlie.b
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
Thankx
Robert Rouse
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 IntegernFilenum = FreeFile()
app_path =
My.Application.Info.DirectoryPathFileOpen(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
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.