Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 23rd, 2007, 12:39 PM   #1
demon101
Hobbyist Programmer
 
demon101's Avatar
 
Join Date: Mar 2006
Location: westboro, ohio
Posts: 163
Rep Power: 0 demon101 is an unknown quantity at this point
Send a message via Yahoo to demon101
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.
__________________
Demon101 Production's

Code Forums
demon101 is offline   Reply With Quote
Old Dec 23rd, 2007, 12:52 PM   #2
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 2,199
Rep Power: 6 Sane will become famous soon enough
Send a message via MSN to Sane
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.
Sane is offline   Reply With Quote
Old Dec 24th, 2007, 7:13 AM   #3
milot
Programmer
 
milot's Avatar
 
Join Date: Nov 2006
Location: Kosovė/Prishtinė
Posts: 47
Rep Power: 0 milot is on a distinguished road
Re: Auto Save

Or you can use System.Windows.Forms.Timer to call the save method e.g every 2 minutes, 2 hours etc.
milot is offline   Reply With Quote
Old Dec 26th, 2007, 10:40 AM   #4
mackenga
Professional Programmer
 
Join Date: Mar 2005
Location: Glasgow, Scotland
Posts: 335
Rep Power: 4 mackenga is on a distinguished road
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.
__________________
"I'm not a genius. Why do I have to suffer?"
mackenga is offline   Reply With Quote
Old Dec 26th, 2007, 1:50 PM   #5
milot
Programmer
 
milot's Avatar
 
Join Date: Nov 2006
Location: Kosovė/Prishtinė
Posts: 47
Rep Power: 0 milot is on a distinguished road
Re: Auto Save

Quote:
Originally Posted by mackenga View Post
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.
milot is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
101 Ways To Help Save The Planet justlukeyou Coder's Corner Lounge 61 Jun 20th, 2007 1:04 PM
How to save all search engine results urls in a text file abojan ASP 0 Dec 27th, 2006 9:33 AM
help on save and save as methods Yarvin Python 2 Nov 9th, 2006 9:01 PM
How to save the array vars in a class? cCj PHP 2 Aug 6th, 2006 1:20 AM
IE Compatibility, margin: auto; (centering) dezza HTML / XHTML / CSS 8 Nov 18th, 2005 4:41 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:56 PM.

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