473,218 Members | 1,509 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,218 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 1141

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...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

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.