Hi Everyone!
I need some help with the scheduler! I can't get it to run. I created a class simular to the sample in the documentation!
All this is clear to me but what do I have to do with my donnetnuke setup.
Do I have to update my web.config file?
What compiled files do I have to copy to the bin folder(they all look weired to me)!
My Class:
-------------------------------------------------------
Imports Microsoft.VisualBasic
Imports System.IO
Namespace DotNetNuke.Modules.MoistureSensitiveItems
''' <summary>
'''
''' </summary>
''' <remarks></remarks>
Public Class AutoEmailNotification
Inherits DotNetNuke.Services.Scheduling.SchedulerClient
Public Sub New(ByVal objScheduleHistoryItem As DotNetNuke.Services.Scheduling.ScheduleHistoryItem)
MyBase.New()
Me.ScheduleHistoryItem = objScheduleHistoryItem
End Sub
Public Overrides Sub DoWork()
Try
Me.Progressing()
MSINotification()
Me.ScheduleHistoryItem.Succeeded = True
Me.ScheduleHistoryItem.AddLogNote("File updated")
Catch ex As Exception
Me.ScheduleHistoryItem.Succeeded = False
Me.ScheduleHistoryItem.AddLogNote("EXEPTION: " + ex.ToString)
'nootification that we have errored
Me.Errored(ex)
'Log the Exception
LogException(ex)
End Try
End Sub
Private Sub MSINotification()
'create filename
Me.Status = "Updating file"
Dim FILENAME As String = MSI_Global.MSI_FILEPATH_TEMPFOLDER & _
DateTime.Now.Year.ToString() & _
DateTime.Now.Month.ToString() & _
DateTime.Now.Day.ToString() & _
DateTime.Now.Hour.ToString() & _
DateTime.Now.Minute.ToString() & _
DateTime.Now.Second.ToString() & ".txt"
'create writestream
Dim objStreamWriter As StreamWriter
objStreamWriter = File.AppendText(FILENAME)
objStreamWriter.WriteLine("I'am running -- " + DateTime.Now.ToString)
'Close the stream
objStreamWriter.Close()
Me.Status = "Updating complete"
Me.ScheduleHistoryItem.AddLogNote("Add new timestamp to file")
Me.ScheduleHistoryItem.Succeeded = True
End Sub
End Class
End Namespace