I needed some help on the best way to delete the last line of text in a text file. I have a subroutine that looks like this, but it is missing some code. Could anyone advise me on this?
Dim strLogFile As String = System.Web.HttpContext.Current.Server.MapPath("~/Log.txt")
Dim fs As New FileStream(strLogFile, FileMode.Open, FileAccess.ReadWrite, FileShare.None)
Dim swLog As New StreamReader(fs)
Dim array As String()
Dim value As String = swLog.ReadToEnd
'Array that holds the lines of the text file.
array = value.Split(vbCrLf)
'code for deleting last line:
View Complete Post