473,574 Members | 2,573 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with auto updating a .text file

6 New Member
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 1755
willakawill
1,646 Top Contributor
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 Recognized Expert Expert
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 New Member
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 AutoUpdateCheck Box_CheckedChan ged(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles AutoUpdateCheck Box.CheckedChan ged
Dim textboxreader As String
With Me
If .AutoUpdateChec kBox.Checked = True Then Timer1.Enabled = True
Timer1.Start()
If Timer1.Equals(1 000) Then
textboxreader = My.Computer.Fil eSystem.ReadAll Text("C:\Users\ Desktop\mytextf ile.txt")
.inTextbox.Text = textboxreader
End If
End With
End Sub
End Class
Jan 6 '07 #4
willakawill
1,646 Top Contributor
something like this?

Private Sub AutoUpdateCheck Box_CheckedChan ged(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles AutoUpdateCheck Box.CheckedChan ged
Dim textboxreader As String
With Me
If .AutoUpdateChec kBox.Checked = True Then Timer1.Enabled = True
Timer1.Start()
If Timer1.Equals(1 000) Then
textboxreader = My.Computer.Fil eSystem.ReadAll Text("C:\Users\ Desktop\mytextf ile.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
5460
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 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I...
1
5488
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 following code after the "Application.Run(new VMSMain());": static void Main() { Application.Run(new VMSMain()); }
16
3232
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 not print in the username or email amddress of the person doing the download - which I am collecting from a form on the previous page. I can get...
0
5546
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 ******************************************************** For this teeny job, please refer to: http://feeds.reddit.com/feed/8fu/?o=25
19
1971
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 joint the two table fields in a query "qrysg" and from that query i have made a form. Now the problem is that whenever i put a new record in the...
6
5115
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 don't remember which major browser didn't support margin: auto, but there was a common hack with some "text-aligns". Is it time to drop the hack? Jeff
1
3105
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 tabs at the top content area should be flush left and the light blue frame should line up under the logo graphic. Looks great in Safari and Firefox...
0
2837
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. Here is the website: holtz-realty And also the html file and css file. Anny help will by mostly appreciated. I did try everything I can think of. ...
5
4188
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, for which number of rows/columns i will not know, and I have to pretty up the table, including a verical scroll bar. This has to work in IE6, IE7, and...
0
7815
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7738
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8077
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8113
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5634
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3755
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2253
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1076
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.