Results 1 to 10 of 10

Thread: [RESOLVED] [02/03] Memory usage

Threaded View

  1. #1

    Thread Starter
    Frenzied Member SomethinCool's Avatar
    Join Date
    Jan 2001
    Location
    Malvern, PA
    Posts
    1,407

    Resolved [RESOLVED] [02/03] Memory usage

    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:
    1. txtActivity.Text = txtActivity.Text & "Monitoring Started on " & DateAndTime.Now & vbNewLine
    2.                 txtActivity.Text = txtActivity.Text & "Logging Activity to: " & logFile & vbNewLine
    3.                 writeToLogFile("Monitoring Started on " & DateAndTime.Now)
    4.  
    5.                 writeToLogFile("Logging Activity to: " & logFile)
    6.  
    7.     Private Sub writeToLogFile(ByVal loggedText As String)
    8.        
    9.         Dim oWrite As New StreamWriter(logFile)
    10.  
    11.         oWrite.WriteLine(loggedText)
    12.  
    13.         oWrite.Flush()
    14.  
    15.         oWrite.Close()
    16.  
    17.     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?
    Last edited by SomethinCool; Jun 2nd, 2006 at 01:03 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width