Hi, I have been given the task of basically reading and writing to and from files. Below is the code from one sub:
If btnSaveRecipe.Enabled = True Then
FileName = "C:\Users\Leyla\Documents\Recipe Task\Recipe.txt"
FileWriter = New IO.StreamWriter(FileName)
For index = 0 To lstRecipe.Items.Count - 1 'For the number of ingredients in the listbox
StrEntry = lstRecipe.Items(index)
FileWriter.Write(StrEntry)
FileWriter.Write(vbNewLine) 'Start a new line
Next
I can't work out what i've done wrong, but when I open the file itself in the folder, it is empty. Please help :)