Windows Service : Timer - Should it work ???

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mr Newbie

    Windows Service : Timer - Should it work ???

    I have a Windows Service and I am using a Timer on it with an interval of 10
    seconds. The assembly has full trust and the service is running under the
    localmachine permission.

    In the timer tick I have the following code.

    Dim fs As New System.IO.FileS tream("C:\ticki ng.txt", IO.FileMode.App end)

    Dim sw As New System.IO.Strea mWriter(fs)

    sw.WriteLine("i m tickin")

    sw.Flush()

    ///

    I have the timer enabled and have used the

    Timer1.Start() in the OnStart sub routine.

    It does not work, any ideas !!!!!!!!!!!!


  • Herfried K. Wagner [MVP]

    #2
    Re: Windows Service : Timer - Should it work ???

    "Mr Newbie" <here@now.com > schrieb:[color=blue]
    >I have a Windows Service and I am using a Timer on it with an interval of
    >10 seconds.[/color]

    Which timer class do you use?

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://classicvb.org/petition/>

    Comment

    • Cor Ligthert [MVP]

      #3
      Re: Windows Service : Timer - Should it work ???

      Herfried,

      If you look in the newsgroup than you can see that it was a windows form
      timer.
      Please keep the answers to the original thread.

      Thanks in advance

      Cor

      "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> schreef in bericht
      news:eeyTl2byFH A.2924@TK2MSFTN GP15.phx.gbl...[color=blue]
      > "Mr Newbie" <here@now.com > schrieb:[color=green]
      >>I have a Windows Service and I am using a Timer on it with an interval of
      >>10 seconds.[/color]
      >
      > Which timer class do you use?
      >
      > --
      > M S Herfried K. Wagner
      > M V P <URL:http://dotnet.mvps.org/>
      > V B <URL:http://classicvb.org/petition/>[/color]


      Comment

      • Cor Ligthert [MVP]

        #4
        Re: Windows Service : Timer - Should it work ???

        Mr Newbie,

        To get the best answers you can better keep your questions to the original
        threads, than everybody can see what answers are already given. This is not
        a new subject.

        Thanks in advance

        Cor

        "Mr Newbie" <here@now.com > schreef in bericht
        news:%23v2awqby FHA.2812@TK2MSF TNGP14.phx.gbl. ..[color=blue]
        >I have a Windows Service and I am using a Timer on it with an interval of
        >10 seconds. The assembly has full trust and the service is running under
        >the localmachine permission.
        >
        > In the timer tick I have the following code.
        >
        > Dim fs As New System.IO.FileS tream("C:\ticki ng.txt", IO.FileMode.App end)
        >
        > Dim sw As New System.IO.Strea mWriter(fs)
        >
        > sw.WriteLine("i m tickin")
        >
        > sw.Flush()
        >
        > ///
        >
        > I have the timer enabled and have used the
        >
        > Timer1.Start() in the OnStart sub routine.
        >
        > It does not work, any ideas !!!!!!!!!!!!
        >
        >[/color]


        Comment

        • Herfried K. Wagner [MVP]

          #5
          Re: Windows Service : Timer - Should it work ???

          "Cor Ligthert [MVP]" <notmyfirstname @planet.nl> schrieb:[color=blue]
          > If you look in the newsgroup than you can see that it was a windows form
          > timer.
          > Please keep the answers to the original thread.[/color]

          I don't read every thread posted to this group...

          --
          M S Herfried K. Wagner
          M V P <URL:http://dotnet.mvps.org/>
          V B <URL:http://classicvb.org/petition/>

          Comment

          • Mr Newbie

            #6
            Re: Windows Service : Timer - Should it work ???

            Very sorry to have made this error. I am soldiering on with the other timer
            classes now and having not much more success. However, it appears to be very
            hit and miss as to if the service will run at all and if debugging allways
            works.

            Very crap I must say ;-(

            Thanks to all for your assistance.


            Regards - Mr Newbie



            "Cor Ligthert [MVP]" <notmyfirstname @planet.nl> wrote in message
            news:eyB1T$byFH A.3320@TK2MSFTN GP14.phx.gbl...[color=blue]
            > Mr Newbie,
            >
            > To get the best answers you can better keep your questions to the original
            > threads, than everybody can see what answers are already given. This is
            > not a new subject.
            >
            > Thanks in advance
            >
            > Cor
            >
            > "Mr Newbie" <here@now.com > schreef in bericht
            > news:%23v2awqby FHA.2812@TK2MSF TNGP14.phx.gbl. ..[color=green]
            >>I have a Windows Service and I am using a Timer on it with an interval of
            >>10 seconds. The assembly has full trust and the service is running under
            >>the localmachine permission.
            >>
            >> In the timer tick I have the following code.
            >>
            >> Dim fs As New System.IO.FileS tream("C:\ticki ng.txt", IO.FileMode.App end)
            >>
            >> Dim sw As New System.IO.Strea mWriter(fs)
            >>
            >> sw.WriteLine("i m tickin")
            >>
            >> sw.Flush()
            >>
            >> ///
            >>
            >> I have the timer enabled and have used the
            >>
            >> Timer1.Start() in the OnStart sub routine.
            >>
            >> It does not work, any ideas !!!!!!!!!!!!
            >>
            >>[/color]
            >
            >[/color]


            Comment

            Working...