VB.Net Console app needs timer

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?QW5keSBTLg==?=

    #16
    RE: VB.Net Console app needs timer

    I would just add the 1 line of code below to make it "sleep" for a certain
    amount of milliseconds. 600,000 milliseconds is approx. 10 minutes.

    System.Threadin g.Thread.Sleep( 600000)


    "Scott M." wrote:
    Hi,
    >
    I'm an old VB6 guy just starting out in VB.Net using Visual Studio
    Express. I want to build a simple console app that will create a
    simple text file every 10 minutes. I can create the file OK, but how
    do I put in the timer so that I can write the file on schedule? The
    idea behind this project is to help me monitor remote computers in a
    production environment to make sure that they are up and running. I
    currently synchronize files on them using DriveHQ.com. What I want to
    do is be able to examine my DriveHQ account and see, from what I write
    in the text file, that my systems are up and running.
    >
    The app coding so far is this;
    >
    'create file
    My.Computer.Fil eSystem.WriteAl lText("C:\Test. txt",
    String.Empty, False)
    'write file header
    My.Computer.Fil eSystem.WriteAl lText("C:\Test. txt", "Heartbeat
    File" & vbCrLf, True)
    'write current date/time to file
    My.Computer.Fil eSystem.WriteAl lText("C:\Test. txt", Now() &
    vbCrLf, True)
    >
    >
    Scott
    >
    >

    Comment

    Working...