title: Read a text file in VB
body: <p>New Visual basic programmer here. Trying to get a textfile to be read by the program but it seems to simply not work, no error messages or anything. It just does not grab the values at all</p>
  
  <p>The textfile name is exactly the same.</p>
  
  <pre><code>Public Sub ReadDef()
  
      Dim DefSR As IO.StreamReader = IO.File.OpenText("BikeDefault.txt")
  
      GlobalTotBikes = DefSR.ReadLine()
      GlobalRentRate = DefSR.ReadLine()
      GlobalHSTRate = DefSR.ReadLine()
      GlobalTourRate = DefSR.ReadLine()
      GlobalGPSRate = DefSR.ReadLine()
      GlobalInsurRate = DefSR.ReadLine()
      GlobalWaterBotRate = DefSR.ReadLine()
      GlobalNextBookNum = DefSR.ReadLine()
      GlobalNextCustNum = DefSR.ReadLine()
      GlobalNextInvoiceNum = DefSR.ReadLine()
  
      DefSR.Close()
  
  End Sub
  </code></pre>
  
  <p>I've compared this code a bunch of times to the example I was given and I see nothing different.</p>
  
  <p>Thanks.</p>