vb.net - VB, creating a save file menu -
is possible vb.2010 create 'save' file option save current app settings file , able 'open' setting. after implementing traditional save, open feature in drop down task bar.
when settings mean load of text box contents etc
you can store in text file, if it's not secure/confidential information.
this example:
' own file name or save place... dim sfd new savefiledialog sfd.showdialog() dim mypath string = sfd.filename ' replace "my.computer.filesystem.specialdirectories.mydocuments & "\name_of_file.txt" "mypath" ' save fileopen(1, my.computer.filesystem.specialdirectories.mydocuments & "\name_of_file.txt", openmode.output) printline(1, textbox1.text) printline(1, textbox2.text) ' , on... fileclose(1) ' load if my.computer.filesystem.fileexists(my.computer.filesystem.specialdirectories.mydocuments & "\name_of_file.txt") fileopen(1, my.computer.filesystem.specialdirectories.mydocuments & "\name_of_file.txt", openmode.input) textbox1.text = lineinput(1) textbox2.text = lineinput(1) ' , on... fileclose(1) end if
remember close file, otherwise you'll memory leaks , sorts of nasty stuff =p
you can use freefile()
next free file number, comes in use when opening multiple files...
this simple method, i'm sure can use template , implement own use.
hope helps
Comments
Post a Comment