Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- If IO.File.Exists("CityNames.txt") = True Then
- 'opening txt file to view
- inFIle = IO.File.OpenText("CityNames.txt")
- 'Array Code
- Dim CityArray(5) As String
- Dim i As Integer = 0
- While inFIle.Peek <> -1
- CityArray(i) = inFIle.ReadLine
- i += 1
- End While
- inFIle.Close()
- 'instantiate StreamWriter
- outFile = IO.File.AppendText("CityNames.txt")
- For intCount = 0 To CityArray.Length - 1
- outFile.WriteLine(CityArray(i))
- Next
- 'close file
- outFile.Close()
- Else
- 'Handles the contingency that the file is missing or corrupt
- MessageBox.Show("File does not exist")
- End If
Add Comment
Please, Sign In to add comment