I am creating a program that will log activity of my program (like file renaming and such). This program will be on for days straight, and my program will log all activity. As of now, I have it writing to a text box and then also writing to a log file like this:
VB Code:
txtActivity.Text = txtActivity.Text & "Monitoring Started on " & DateAndTime.Now & vbNewLine txtActivity.Text = txtActivity.Text & "Logging Activity to: " & logFile & vbNewLine writeToLogFile("Monitoring Started on " & DateAndTime.Now) writeToLogFile("Logging Activity to: " & logFile) Private Sub writeToLogFile(ByVal loggedText As String) Dim oWrite As New StreamWriter(logFile) oWrite.WriteLine(loggedText) oWrite.Flush() oWrite.Close() End Sub
Over time, having the log write to a text box will use up a lot of memory right? Would it be more efficient to write to a log and read from the log file and output that data to a text box?





Reply With Quote