Re: VB.Net Console app needs timer

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



On Jul 6, 4:58 pm, "Scott M." <quan...@xxxxxxxxx> wrote:
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


Hmm... sorry to hear that your VB.Net application bombed. If it's not
too long would you mind posting the source? Perhaps we could educate
you on what might have went wrong?\.

Thanks,

Seth Rowe

.



Relevant Pages

  • Re: VB.Net Console app needs timer
    ... There is no windows service template for Express, ... it hide itself and use the scheduler as Mark indicates. ... build and took the exe to my target machine. ... I took this to my target machine and ran setup. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Application not working on other PCs
    ... I've created an application (.exe) using VC++ 2005 on my Windows Vista ... Almost certainly, you are using dynamic linking of CRT, but the necessary DLL's are not present on the target machine. ...
    (microsoft.public.vc.language)
  • Re: executable
    ... ahh - take all the assemblies in teh debug directory and copy then to the same directory ono the target machine ... The exe works fine when I run it from the original ... > Incoming mail is certified Virus Free. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: .NET and sharing dlls?
    ... >EXE will be run, NGEN produces less efficient code than the JIT ... AFAIK ngen and JIT compiler uses the same compiler just in different ... modes and also both run on target machine (as opposite to developer ...
    (borland.public.delphi.non-technical)
  • RE: Dependencies in my Setup project
    ... Thanks Todd - The problem is that I only have this .exe and not the ... that the file gets placed in the correct folder on the target machine. ... But that is when I get the dependency error that this exe is associated ... This error only occurs when I do a rebuild of the setup ...
    (microsoft.public.dotnet.languages.csharp)