Return to Snippet

Revision: 23245
at February 2, 2010 00:16 by mracoker


Initial Code
Sub Log(ByVal txt As String)
        'Open a file for writing
        Dim FILENAME As String = Server.MapPath("Log.txt")

        'Get a StreamReader class that can be used to read the file
        Dim objStreamWriter As StreamWriter
        
        objStreamWriter = File.AppendText(FILENAME)

        objStreamWriter.WriteLine(DateTime.Now.ToString() + " >> " + txt)
    
        'Close the stream
        objStreamWriter.Close()
    End Sub

Initial URL

                                

Initial Description

                                

Initial Title
VB.NET Log File

Initial Tags
file, log

Initial Language
VB.NET