How to declare text with a line

后端 未结 4 1727
日久生厌
日久生厌 2021-01-28 23:03

I\'m new to programming and decided to take VB.net up as my first language, I\'m quite new and I\'m currently trying to write a sorting program. I\'m trying to load in a file, s

4条回答
  •  -上瘾入骨i
    2021-01-28 23:29

    You could try this to save every number of the file in a array:

      Dim fileReader As StreamReader
        fileReader = My.Computer.FileSystem.OpenTextFileReader("F:\\test.txt")
    
        Dim numeros As New List(Of String)
    
        Dim stringReader As String
        stringReader = Convert.ToChar(fileReader.Read)
    
        Do While (fileReader.Peek() >= 0)
            stringReader = Convert.ToChar(fileReader.Read)
    
            If stringReader Like "#" Then
                numeros.Add(stringReader)
            End If
        Loop
    

提交回复
热议问题