Streamreader lockup Help please..

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

For some reason, my program is locking up on the "New Streamreader(fs)" part
in my program.. I doublechecked everything but nothing is changed since the
last time
I worked on it. and then it was working at that time..

Does anyone know why it lockes up on that Streamreader?

Dim myfilename As String = "C:\helpme.txt"
Dim fs As FileStream = New FileStream(myfilename, FileMode.Open)
Dim stream_reader As StreamReader = New StreamReader(fs)

Thanks so much.
 
Mr Dutchie said:
For some reason, my program is locking up on the "New Streamreader(fs)"
part
in my program.. I doublechecked everything but nothing is changed since
the
last time
I worked on it. and then it was working at that time..

Does this occur when running the application inside the IDE? Did you try to
run the application outside the IDE? Are you sure the path/file is
accessible?
 
ok, my fault.. i deleted the 'test' file by accident.
recreated it and now it works, except
it locks up on this

Private Function GetTotalRows() As Long
Dim rl As String
Dim myReader As New StreamReader("C:\newsgroups.txt")
Do While stream_reader.Peek <> -1
rl = stream_reader.ReadLine
GetTotalRows = GetTotalRows + 1
Loop
End Function


it's locking up in the "Do While stream_Reader" part

the text file contains this information

False .usa 0003818757 0003818747
False 1a.greenville.goal 0000116459 0000116397
False 1a.pacificcoastnet 0000111463 0000111397
False 1stone.archive 0000111472 0000111406

and just want the total lines of it.. That part used to work though.
but after one of my XP updates it doesn't work. (I dont have XP SR2
installed, just SR1)
 
Back
Top