streamreader.readblock
streamreader.readblock
streamreader.readblock
streamreader.readblock
streamreader.readblock
streamreader.readblock streamreader.readblock streamreader.readblock streamreader.readblock streamreader.readblock streamreader.readblock streamreader.readblock
streamreader.readblock streamreader.readblock
streamreader.readblock
Directory / File IO / Registry Topics include: IO, file system and the registry

Enjoy an ad free experience by logging in. Not a member yet? Register.
Go Back  Xtreme .NET Talk > > > streamreader.readblock


Reply
 
Thread Tools Display Modes
  #1  
Old 08-13-2004, 08:09 PM
gildfosh gildfosh is offline
Newcomer
 
Join Date: Aug 2004
Posts: 1
gildfosh is on a distinguished road
Default streamreader.readblock



I don't understand how this function works...here is my situation, I have a file with a list, for example:

Item 1
Item 2
Item 3
Item 4
Item 5

in a text file. Now, this file is over 4 megabytes, so there are lots of lines. i have built a program to get the byte position of let's say item 500 so it's easier to access a line rather than just going through the entire list looking for an item. How do I use streamreader to go to a byte position in a file and read the entire line? I have attempted to do this in severa; ways, but it is always off a couple bytes.
Reply With Quote
  #2  
Old 08-13-2004, 08:15 PM
PlausiblyDamp's Avatar
PlausiblyDampstreamreader.readblock PlausiblyDamp is offline
Ultimate Contributor

Preferred language:
C#, VB
 
Join Date: Sep 2002
Location: Lancashire, UK
Posts: 6,487
PlausiblyDamp is on a distinguished road
Default

If you create a filestream and base your streamreader on that you could seek the underlying stream to the correct position and then read from the streamreader.
__________________
Posting Guidelines FAQ Post Formatting

Intellectuals solve problems; geniuses prevent them.
-- Albert Einstein
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
StreamReader SonicBoomAu Directory / File IO / Registry 6 03-23-2005 02:53 PM
StreamReader Question atmosphere1212 Directory / File IO / Registry 5 12-01-2004 04:49 AM
StreamReader dmdougla Network 3 05-05-2004 12:39 PM
streamreader ThePentiumGuy Directory / File IO / Registry 8 01-02-2004 08:44 PM
Problem with StreamReader Jblake00 Directory / File IO / Registry 14 10-25-2003 05:53 AM

Advertisement:







Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
streamreader.readblock
streamreader.readblock
streamreader.readblock streamreader.readblock
streamreader.readblock
streamreader.readblock
streamreader.readblock streamreader.readblock streamreader.readblock streamreader.readblock streamreader.readblock streamreader.readblock streamreader.readblock
streamreader.readblock
streamreader.readblock
 
streamreader.readblock
streamreader.readblock