Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Visual Basic (http://www.programmingforums.org/forum18.html)
-   -   Auto Save (http://www.programmingforums.org/showthread.php?t=14793)

demon101 Dec 23rd, 2007 12:39 PM

Auto Save
 
i have been tryin to figure out how i can take like text i have in my program and have it auto save in a .txt file where the application is at.

i have searched and searched google and havent been able to find anything on it so if someone could help me i would like it.

Sane Dec 23rd, 2007 12:52 PM

Re: Auto Save
 
As far as I know, there's no feature in VB that allows you to do this automatically. You'll have to program a function that's triggered for the text field update event. You will program this function to grab the current value of the text field and save it to a .txt file. That way, every time the text is changed, you have that value updated in a text file.

Then when the program's loaded, use the "on load" event to trigger a separate function. You will program this function to do the inverse: grab the contents of the .txt file and put it back in the field of the text control.

milot Dec 24th, 2007 7:13 AM

Re: Auto Save
 
Or you can use System.Windows.Forms.Timer to call the save method e.g every 2 minutes, 2 hours etc.

mackenga Dec 26th, 2007 10:40 AM

Re: Auto Save
 
System.Windows.Forms.Timer isn't relevant to this forum - but the Timer control is. (Note: this is not VB.NET land, but classic VB land, unless I'm much mistaken...)

To use the timer control, just drop it onto a form, give it a sensible name and then catch its Timer event.

milot Dec 26th, 2007 1:50 PM

Re: Auto Save
 
Quote:

Originally Posted by mackenga (Post 138728)
System.Windows.Forms.Timer isn't relevant to this forum - but the Timer control is. (Note: this is not VB.NET land, but classic VB land, unless I'm much mistaken...)

To use the timer control, just drop it onto a form, give it a sensible name and then catch its Timer event.

There are two different classes named "Timer", System.Threading.Timer, and Timer Control (System.Windows.Forms.Timer), thats the reason that I mentioned the whole namespace hierarchy.


All times are GMT -5. The time now is 3:39 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC