N
Nijazi Halimaji
Hi
Something wont work on my simple test windows service... I made a simple
service which writes a value into a file each minute with a timer... but the
file never would be created...
Thats my code (2005)
Public Class myService
Public Sub New()
MyBase.New()
' This call is required by the Windows Form Designer.
InitializeComponent()
tmr_check.Interval = 60000
' Add any initialization after the InitializeComponent() call.
End Sub
Protected Overrides Sub OnStart(ByVal args() As String)
' Add code here to start your service. This method should set things
' in motion so your service can do its work.
tmr_check.Enabled = True
End Sub
Protected Overrides Sub OnStop()
' Add code here to perform any tear-down necessary to stop your service.
tmr_check.Enabled = False
End Sub
Private Sub tmr_check_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles tmr_check.Tick
Dim aStreamWriter As System.IO.TextWriter
aStreamWriter = New System.IO.StreamWriter("C:\tmp.txt")
aStreamWriter.Write("sdfsdfsf")
aStreamWriter.Close()
End Sub
End Class
Is there something wrong?
Nijazi Halimaji
Something wont work on my simple test windows service... I made a simple
service which writes a value into a file each minute with a timer... but the
file never would be created...
Thats my code (2005)
Public Class myService
Public Sub New()
MyBase.New()
' This call is required by the Windows Form Designer.
InitializeComponent()
tmr_check.Interval = 60000
' Add any initialization after the InitializeComponent() call.
End Sub
Protected Overrides Sub OnStart(ByVal args() As String)
' Add code here to start your service. This method should set things
' in motion so your service can do its work.
tmr_check.Enabled = True
End Sub
Protected Overrides Sub OnStop()
' Add code here to perform any tear-down necessary to stop your service.
tmr_check.Enabled = False
End Sub
Private Sub tmr_check_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles tmr_check.Tick
Dim aStreamWriter As System.IO.TextWriter
aStreamWriter = New System.IO.StreamWriter("C:\tmp.txt")
aStreamWriter.Write("sdfsdfsf")
aStreamWriter.Close()
End Sub
End Class
Is there something wrong?
Nijazi Halimaji