...doing its job properly? For a school project I have to make a piece of software that holds logs.
Unfortunately I can't figure out what's wrong with this code, as it DOES make a new file, but it doesn't write anything to it.
Does anybody know what's wrong with my code? Thanks.
ElseIf My.Computer.FileSystem.FileExists("c:\LogKeeper\logs\" + TextYesNo + ".rtf") = True Then
Dim rlogdata As New System.IO.StreamReader("c:\LogKeeper\intlogs\" + TextYesNo + ".txt")
Dim prevdata As New ArrayList
Do While rlogdata.Peek <> -1
prevdata.Add(rlogdata.ReadLine())
Loop
rlogdata.Close()
My.Computer.FileSystem.DeleteFile("c:\LogKeeper\intlogs\" + TextYesNo + ".txt")
Dim wlogdata As New System.IO.StreamWriter("c:\LogKeeper\intlogs\" + TextYesNo + ".txt", True)
For Each item As String In prevdata
wlogdata.WriteLine(item)
Next
wlogdata.Close()
Unfortunately I can't figure out what's wrong with this code, as it DOES make a new file, but it doesn't write anything to it.
Does anybody know what's wrong with my code? Thanks.
ElseIf My.Computer.FileSystem.FileExists("c:\LogKeeper\logs\" + TextYesNo + ".rtf") = True Then
Dim rlogdata As New System.IO.StreamReader("c:\LogKeeper\intlogs\" + TextYesNo + ".txt")
Dim prevdata As New ArrayList
Do While rlogdata.Peek <> -1
prevdata.Add(rlogdata.ReadLine())
Loop
rlogdata.Close()
My.Computer.FileSystem.DeleteFile("c:\LogKeeper\intlogs\" + TextYesNo + ".txt")
Dim wlogdata As New System.IO.StreamWriter("c:\LogKeeper\intlogs\" + TextYesNo + ".txt", True)
For Each item As String In prevdata
wlogdata.WriteLine(item)
Next
wlogdata.Close()