473,382 Members | 1,421 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,382 software developers and data experts.

vb.net service on win2k advanced server

psb
Hello,

I log all of my website/application errors to the event log. I have written
an service in vb.net that polls the event log every x hours and dumps all of
the "errors" to an email and sends it to necessary people and me.
----------------------------------------------------
Protected Overrides Sub OnStart(...)
Timer1.Interval = GetTimerIntervalInMilliSeconds()
Timer1.Enabled = True
End Sub
-----------------------------------
Private Sub Timer1_Elapsed(...)
Dim strContent As String
Dim aryEmailListTo As Array

aryEmailListTo = GetEmails()
strContent = MakeEmailBodyFromEventLogErrors()

SendEmail(aryEmailListTo, _EML_FROM, _EML_SUBJECT, strContent)
End Sub
------------------------------------------------------

EVERYTIME I restart the service (or reboot) it sends a TON of emails to me,
like timer1_elapsed is getting called a TON of times. Am I not setting the
Timer Interval in the right place? After it sends a TON of emails, it works
perfectly. If I set the interval to 2 hours, it works perfectly; i.e.,
every 2 hours I get 1 email with all of the relevant errors in the event
log, but the initial start sends me like 50 emails.

I made this about a year ago, and made it quickly with a "Make an NT service
in 5 minutes with vb.net" tutorial. I am finally debugging since I have to
make another new service and this would cripple the application if the
timer1.elapsed gets run 50 times on startup. I am pretty sure it didn't
error like this on my laptop when developing this.

thanks for any response,
-psb
Nov 22 '05 #1
0 670

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

Similar topics

0
by: Michael J. Wendell | last post by:
Hello, I am trying to debug an issue with sessions in my ASP 3.0 web application, which runs fine on WIN2K Pro and WINXP Pro, yet fails to function correctly on WIN2K Advanced Server. My actual...
0
by: psb | last post by:
Hello, I log all of my website/application errors to the event log. I have written an service in vb.net that polls the event log every x hours and dumps all of the "errors" to an email and...
10
by: p175 | last post by:
Hi folks, I'm after some guidelines on general memory allocations for DB2 8.2.2 ESE on Win2k Server FP4 with 4gb physical memory. Seeing as everything is 32bit and win2k server does not...
6
by: alanknipmeyer | last post by:
Hi, I`m in the process of migrating a Access 2002 (Run in 2000 mode) from Windows 98 to Win2K Server. It is a shared resource via a file share on the 98 Server. Client systems are Win98 with the...
1
by: Dave | last post by:
I wrote a C# windows service and it will install on Win2K but won't start. I have code in it to write to the event log but it doesn't log anything. I developed it on WinXP with VS and it...
6
by: Werner T via DotNetMonster.com | last post by:
I'm not entirely new to ASP.NET but the following problem has cost me many hours of frustration and I still do not have a solution: I have Visual Studio .NET and IIS5 installed on a laptop...
3
by: GTDriver | last post by:
I'm trying to connect my application with a web service located on my own web server(localhost). I guess when the solution/proect is built it makes a file called 'Web...
5
by: Andrew | last post by:
Hey all, Requesting help from the VB.Net gurus in here. I was given a task to write a Windows Service (VB.Net) that would run an external program, and if that program closed for any reason...
3
dmjpro
by: dmjpro | last post by:
plz send me a good link which can clearify me how the J2EE framework works i want the details information .... plz help thanx
1
by: ERobishaw | last post by:
A windows service I've created runs on all boxes except Windows 2000 server. The windows service initializes (i.e., the Service:ServieBase class gets constructed), but the OnStart() method...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...

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.