0% found this document useful (0 votes)
5 views1 page

MR Manyeruke File

The document is a Visual Basic program that writes an array of names to a text file and then reads them back into a new array. It initializes a StreamWriter to save names to 'Names.txt' and uses a StreamReader to read the names back. Finally, it displays the names from the new array in the console.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

MR Manyeruke File

The document is a Visual Basic program that writes an array of names to a text file and then reads them back into a new array. It initializes a StreamWriter to save names to 'Names.txt' and uses a StreamReader to read the names back. Finally, it displays the names from the new array in the console.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Imports System.

IO
Imports System.Console
Module Module1

Sub Main()
Dim newarray(4) As String
Dim NamesArray() As String = {"rick", "dawn", "ishe", "kin"}
Dim name As String
Dim file1 As StreamWriter
file1 = New StreamWriter("C:\Users\.ernest\OneDrive\Desktop\Names.txt")
For count = 0 To 3
name = NamesArray(count)
file1.WriteLine(name)
Next
file1.Close()
ReadKey()
Dim f2 As StreamReader
f2 = New StreamReader("C:\Users\.ernest\OneDrive\Desktop\Names.txt")
Dim index As Integer
Do
newarray(index) = f2.ReadLine
index = index + 1
Loop Until f2.EndOfStream
WriteLine("Your New Array is: ")

For count = 0 To 3

WriteLine(newarray(count))
Next
ReadKey()

End Sub

End Module

You might also like