title: Output random lines from a large document to a TextBox
body: <p>I'm trying to make a program that reads a large document, for example the bible, and outputs multiple random lines. I can get it to output one random line, but no others. </p>
  
  <p>The end goal is to have a user input to determine how many lines are displayed. </p>
  
  <p>Here's my code:</p>
  
  <pre><code>Public Class Form1
      Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
          ' Dim howmanylines As Integer
          ' howmanylines = InputBox("how many lines for paragrpah", "xd",,,)
          'Dim count As Integer = 0
          ' Do Until count = howmanylines
          Dim sr As New System.IO.StreamReader("C:\Users\Dumpster Fire\Desktop\bible.doc")
          Dim sr2 As New System.IO.StreamReader("C:\Users\Dumpster Fire\Desktop\bible.doc")
          Dim sr3 As New System.IO.StreamReader("C:\Users\Dumpster Fire\Desktop\bible.doc")
          Dim xd As Integer = 0
          Dim curline As Integer = 0
          Dim random As Integer = 0
          Do Until sr.EndOfStream = True
              sr.ReadLine()
              xd = xd + 1
          Loop
          sr.Dispose()
          sr.Close()
          Randomize()
          random = Rnd() * xd
          Do Until curline = random
              TextBox1.Text = sr2.ReadLine
  
              ' curline = curline + 1
              Randomize()
              random = Rnd() * xd
  
              TextBox1.Text = sr3.ReadLine
  
              curline = curline + 1
  
              '   count = count + 1
          Loop
      End Sub
  End Class
  </code></pre>