C
Cam Evenson
Guest
I have built a Winform application which evaluates data in a folder and exports that data to a Database. On the form is a button which starts a timing function and evaluates the folder for changes and if there should be new data it uploads it to the Database. What I would like to do is configure the application to run the code which the button calls from the command prompt without loading up the Winform. How would I do this?
The code under the button is:
Private Sub btnAuto_Click(sender As Object, e As EventArgs) Handles btnAuto.Click
' Initiates the Automatic mode which collects and process data without interaction
Try
WindowState = FormWindowState.Minimized
If File.Exists(_storageData) Then
_files = File.ReadAllLines(_storageData).ToList
Else
File.WriteAllLines(_storageData, _files)
End If
CheckFiles()
With CycleTimer
.Interval = 2000
.Enabled = True
End With
LogFileClean()
Catch ex As Exception
ErrorLogger.WriteToErrorLog("Errors", ex.Message, ex.StackTrace)
End Try
End Sub
Continue reading...
The code under the button is:
Private Sub btnAuto_Click(sender As Object, e As EventArgs) Handles btnAuto.Click
' Initiates the Automatic mode which collects and process data without interaction
Try
WindowState = FormWindowState.Minimized
If File.Exists(_storageData) Then
_files = File.ReadAllLines(_storageData).ToList
Else
File.WriteAllLines(_storageData, _files)
End If
CheckFiles()
With CycleTimer
.Interval = 2000
.Enabled = True
End With
LogFileClean()
Catch ex As Exception
ErrorLogger.WriteToErrorLog("Errors", ex.Message, ex.StackTrace)
End Try
End Sub
Continue reading...