473,414 Members | 1,729 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Help with auto updating a .text file

6
Hello, I'm pretty new at trying to do things in visual basic and I've been following some steps to do a few things like writing to a .txt file and reading from that same .txt file.
Link for writing to a text file
Link for reading from a text file

so lets say that I have a brother and we are using 2 different computers over a network and we are communicating via this program on the network

I type something into the text box and it get's saved to the notepad and he clicks a button and get's what I typed into the notepad printed onto his screen.
Here is what I'm trying to do
I'm trying to make it so that if one of us checks a "checkbox" on the form that it will automatically update the list every time one of us types something and saves it to that .txt file.so they don't have to manually click a button every minute to check for something one of us typed.

I've got most of the code working (which isn't much) but I'm having trouble with the autoupdate checkbox. Any help would be appreciated
Jan 5 '07 #1
4 1750
willakawill
1,646 1GB
Hello, I'm pretty new at trying to do things in visual basic and I've been following some steps to do a few things like writing to a .txt file and reading from that same .txt file.
Link for writing to a text file
Link for reading from a text file

so lets say that I have a brother and we are using 2 different computers over a network and we are communicating via this program on the network

I type something into the text box and it get's saved to the notepad and he clicks a button and get's what I typed into the notepad printed onto his screen.
Here is what I'm trying to do
I'm trying to make it so that if one of us checks a "checkbox" on the form that it will automatically update the list every time one of us types something and saves it to that .txt file.so they don't have to manually click a button every minute to check for something one of us typed.

I've got most of the code working (which isn't much) but I'm having trouble with the autoupdate checkbox. Any help would be appreciated
Hi. You can use a timer control and set the timer event to check the file for you rather than a button
Jan 5 '07 #2
Killer42
8,435 Expert 8TB
Hi. You can use a timer control and set the timer event to check the file for you rather than a button
Yes, all the checkbox control would need to do is set the Enabled property of the Timer control to True or False. Don't forget to set the Interval property of the timer control when you place it on the form - probably to something like 60000.
Jan 5 '07 #3
bmruze
6
Yes, all the checkbox control would need to do is set the Enabled property of the Timer control to True or False. Don't forget to set the Interval property of the timer control when you place it on the form - probably to something like 60000.
something like this?

Private Sub AutoUpdateCheckBox_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AutoUpdateCheckBox.CheckedChanged
Dim textboxreader As String
With Me
If .AutoUpdateCheckBox.Checked = True Then Timer1.Enabled = True
Timer1.Start()
If Timer1.Equals(1000) Then
textboxreader = My.Computer.FileSystem.ReadAllText("C:\Users\Deskt op\mytextfile.txt")
.inTextbox.Text = textboxreader
End If
End With
End Sub
End Class
Jan 6 '07 #4
willakawill
1,646 1GB
something like this?

Private Sub AutoUpdateCheckBox_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AutoUpdateCheckBox.CheckedChanged
Dim textboxreader As String
With Me
If .AutoUpdateCheckBox.Checked = True Then Timer1.Enabled = True
Timer1.Start()
If Timer1.Equals(1000) Then
textboxreader = My.Computer.FileSystem.ReadAllText("C:\Users\Deskt op\mytextfile.txt")
.inTextbox.Text = textboxreader
End If
End With
End Sub
End Class
Not quite. You are using vb.NET so I don't have experience of the timer control in that environment. Look for the timer event for the control. When you activate the timer it should create a timer event when it reaches the time set.
Jan 6 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
1
by: Alpha | last post by:
I have a Window based application that shows up still running in the task manager when I close it. It reaches the "this.close" statement and then it stops at the "}" at the section of the...
16
by: matt | last post by:
I have used some free code for listing files for download, but I want to send an email to the administrator when the file has been downloaded. I have got some code in here that does it, but it will...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
19
peeaurjee
by: peeaurjee | last post by:
hi Its my first post to e-scripts. i hope i will get help soon for my problem. I have 2 tables Employees and the second one is Training. The relation between them is 1 to 1. i have...
6
by: Jeff | last post by:
Updating my bag of tricks again. What's the level of support for margin: auto. Is this widely supported now amongst almost all browsers? It's a common request to have a "centered" page. I...
1
by: innivive | last post by:
I am having a problem with having margins display correctly in IE7, Firefox and Safari. I am not sure if it is the "double margin error" or something else. Any help would be appreciated. The file...
0
by: richard12345 | last post by:
Hi Guys I have problem with site I am building. The sidebar with menu and other thinks is overlapping footer. The footer move with the content and but it dos it dos not move with the sidebar. ...
5
by: Stepheno | last post by:
Hi, I am a recently converted Iseries (AS/400) RPG programmer trying to learn HTML/CSS/JavsScript all at the same time (not fun). My problem deals mostly with CSS. I will be reveiving a table,...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.