473,406 Members | 2,259 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,406 software developers and data experts.

Why two messageBoxes?

Hello all!
I'm running a fileWatch on a file. When the the file has a LastWrite, it
will prompt a message box. Only looking at that file, and no Sub Directories.

Private Sub FileSystemWatcher1_Changed(ByVal sender As System.Object,
ByVal e As System.IO.FileSystemEventArgs) Handles FileSystemWatcher1.Changed

MessageBox.Show("All Bets Are On", "Bets")
End Sub
I do have a Store Procedure changing the file, but it's just changing one
value on the file. The Message box always comes up twice. Why is this?

Thanks!

Rudy
Jul 31 '06 #1
2 1148

Rudy wrote:
Hello all!
I'm running a fileWatch on a file. When the the file has a LastWrite, it
will prompt a message box. Only looking at that file, and no Sub Directories.

Private Sub FileSystemWatcher1_Changed(ByVal sender As System.Object,
ByVal e As System.IO.FileSystemEventArgs) Handles FileSystemWatcher1.Changed

MessageBox.Show("All Bets Are On", "Bets")
End Sub
I do have a Store Procedure changing the file, but it's just changing one
value on the file. The Message box always comes up twice. Why is this?

Thanks!

Rudy
Because two different things are happening to the file. I'm not sure
exactly because I never used FileSystemWatcher, but its probably
something like:
File opened
File read to memory
Data changed in memory
(event raised here) original file deleted
(event raised here) new file written.

Or something like that. Anyway, try seeing what options are availabe in
the "e" variable. And check only for the event you care about.

Cheers,
Vincent.

Aug 1 '06 #2
Thanks Vincent!

"Vincent" wrote:
>
Rudy wrote:
Hello all!
I'm running a fileWatch on a file. When the the file has a LastWrite, it
will prompt a message box. Only looking at that file, and no Sub Directories.

Private Sub FileSystemWatcher1_Changed(ByVal sender As System.Object,
ByVal e As System.IO.FileSystemEventArgs) Handles FileSystemWatcher1.Changed

MessageBox.Show("All Bets Are On", "Bets")
End Sub
I do have a Store Procedure changing the file, but it's just changing one
value on the file. The Message box always comes up twice. Why is this?

Thanks!

Rudy
Because two different things are happening to the file. I'm not sure
exactly because I never used FileSystemWatcher, but its probably
something like:
File opened
File read to memory
Data changed in memory
(event raised here) original file deleted
(event raised here) new file written.

Or something like that. Anyway, try seeing what options are availabe in
the "e" variable. And check only for the event you care about.

Cheers,
Vincent.

Aug 5 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Tony | last post by:
How do I get the browser to display a message box using C# in ASP.NET? Something similar to Javascripts Alert( ) type messagebox...
0
by: Boomessh | last post by:
Hai all, I am working on a C# 3 tier application. I want to make all MessageBoxes appear in the local language (currently the Messageboxes appear in English). In what way can i implement this,...
2
by: Claire | last post by:
I need my communication status window to be topmost when it's open/active. Ive set the TopMost property of the form to true and it does work ok. After performing tasks this window generates an...
0
by: Robert W. | last post by:
I read this and am a bit confused: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWindowsFormsMessageBoxClassTopic.asp If I display a messagebox from...
0
by: luna | last post by:
need a basic message box - that when an exit button is pressed it checks the state of a variable if its true then it exits - if its false then a message pops up saying you havent saved - are you...
4
by: Carlos | last post by:
Hi all, I am new to asp in general, and I would like to know if it is good practice just to display a messagebox after a form validation is performed and the user must be warned about missing...
3
by: Tim Osborne | last post by:
Hi I am currently investigating a very annoying problem with one of our applications. We have a UserControl that runs in IE. As the control fires up the constructor does some status...
1
by: zimdanen | last post by:
I am trying to use NUnit for testing, at the insistence of a coworker. In order to test the code, I are using an MDI (also at the insistence of that coworker) so that I can get to the forms that I...
2
by: mahesh123 | last post by:
Hi, I want to display messages in my asp.net pages.i kept Msgbox().But it is working only in the localhost.After uploading it is not working.I think it is server side thats why it is not showing...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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
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...
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
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...

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.