Re: VB.Net Console app needs timer
- From: "Scott M." <quanker@xxxxxxxxx>
- Date: Fri, 06 Jul 2007 20:58:05 -0000
On Jul 6, 1:53 pm, rowe_newsgroups <rowe_em...@xxxxxxxxx> wrote:
On Jul 6, 1:35 pm, "Scott M." <quan...@xxxxxxxxx> wrote:
On Jul 6, 12:35 pm, "Mr. Arnold" <MR. Arn...@xxxxxxxxxx> wrote:
windows service (is this possible in express?) instead of a console
Yes, you can create service application with Express, by coding it yourself.
There is no windows service template for Express, like there is for
Professional. There are examples out on Google on how to code the service,
in VB or C#.NET.
Hi all,
I appreciate all your advice. I decided against a console app because
I don't want to see a DOS box pop up. All I want to do is write out a
simple file that holds something like;
Heartbeat File
06/07/2007 1:25:59 PM
in it and then overwrites it 10 minutes later (or 20 or 30 or one
hour, it doesn't really matter). I can monitor this file remotely and
I will know if the computer is up and running by looking at the last
timestamp written in the file. I don't need a user interface or a
system tray icon or anything. I have never created a service
application but I will try to figure out how to do that. It seems like
a good solution. Barring that, I can make a simple Windows app, make
it hide itself and use the scheduler as Mark indicates.
This project must sound pretty lame to you guys, but I am just getting
my feet wet with Visual Studio and VB6 hasn't prepared me at all for
the realities of true OO Programming. I even signed up with
LearnVisualStudio.net to start my learning curve.
Scott
I'm saying a service would be overkill for this - and if you're just
learning you may want to steer clear of services for a bit - they can
get a bit tricky. My personal recommendation would be to create the
following exe and execute it with the task scheduler like so:
1) Start a New Window's Application project
2) Delete the default form it creates (usually called Form1)
3) Add a new module to the project called Module1 (or whatever)
4) Put your code to write the file in the Sub Main() method
5) Go to the Application tab on your project's properties (Project-->MyProjectName Properties)
6) Uncheck "Enable application framework"
7) Select "Module1" from the Startup Object drop down
8) Rebuild your app and deploy the exe (usually found in My Documents-->Visual Studio 2005-->Project-->MySolutionName-->MyProjectName-->bin--
release-->*.exe)
9) Schedule your task to run every ten minutes
10) Grab a beer and relax (I needed a tenth step :-))
Thanks,
Seth Rowe- Hide quoted text -
- Show quoted text -
Thanks Seth,
I followed all of your steps, except 10. That will come later.
Certainly going to .Net makes for a more complicated world. I ran a
build and took the exe to my target machine. I tried to run it, but
since it did not have the .net framework on it, I got a nasty message.
OK, so then I go back and run Publish, creating a large directory of
files. I took this to my target machine and ran setup. Of course, I
had to accept giving Microsoft my first born (too late) and then for
10 minutes or so it downloaded a bunch of files. I then was able to
run the setup. It took so long that I walked away. When I returned, I
found that my application, Heartbeat.exe, had cause great grief and I
was asked if I wanted to send Bill an error report. I chose No because
he has never responded to any other error report.
So, I went back to VB6. I created the application is 10 minutes,
created an exe and copied the exe to the target machine. It worked
just fine. I then set up scheduler to run it every 10 minutes. I then
set up my DriveHQ Backup software to back it up to the web. It is all
working fine. The VB project, by the way, is a simple three files (3K,
1K and 1K) with a 22K executable.
I'll still start my Visual Studio training, but the future looks
complicated.
Scott
.
- Follow-Ups:
- Re: VB.Net Console app needs timer
- From: rowe_newsgroups
- Re: VB.Net Console app needs timer
- From: Mark S. Milley, MCSD (BinarySwitch)
- Re: VB.Net Console app needs timer
- References:
- VB.Net Console app needs timer
- From: Scott M.
- Re: VB.Net Console app needs timer
- From: Egghead
- Re: VB.Net Console app needs timer
- From: Scott M.
- Re: VB.Net Console app needs timer
- From: Al G
- Re: VB.Net Console app needs timer
- From: Scott M.
- Re: VB.Net Console app needs timer
- From: Chris Dunaway
- Re: VB.Net Console app needs timer
- From: Scott M.
- Re: VB.Net Console app needs timer
- From: Mark S. Milley, MCSD (BinarySwitch)
- Re: VB.Net Console app needs timer
- From: Mr. Arnold
- Re: VB.Net Console app needs timer
- From: Scott M.
- Re: VB.Net Console app needs timer
- From: rowe_newsgroups
- VB.Net Console app needs timer
- Prev by Date: Re: rounding to 9's
- Next by Date: Re: Bug in VS 2005 ?
- Previous by thread: Re: VB.Net Console app needs timer
- Next by thread: Re: VB.Net Console app needs timer
- Index(es):
Relevant Pages
|