Results 1 to 4 of 4

Thread: [RESOLVED] Stream reader next position

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2008
    Posts
    15

    Resolved [RESOLVED] Stream reader next position

    Thanks..my first problem is solved but now I need to move the next read position of the filestream back to the beginning + offset ... I have tried using seek and position but I cant make them work !

  2. #2
    Frenzied Member bmahler's Avatar
    Join Date
    Oct 2005
    Location
    Somewhere just west of the Atlantic
    Posts
    1,568

    Re: Stream reader next position

    you can set the position using the BaseStream.Position method of the StreamReader object.
    Boooya
    • Visual Studio 2008 Professional
    • Don't forget to use [CODE]your code here[/CODE] when posting code
    • Don't forget to rate helpful posts!
    • If you're question was answered please mark your thread [Resolved]


    Code Contributions:
    PHP
    PHP Image Gallery v1.0PHP Image Gallery v2.0
    VB 2005
    Find Computers on a networkSimple License EncryptionSQL Server Database Access dllUse Reflection to Return Crystal ReportDocumentSilently Print PDFGeneric Xml Serailizer


    Useful Links: (more to come)
    MSDN (The first and foremost)MSDN Design Guidelines API Reference • Inno Setup CompilerInno Setup PreprocessorISTool - Fairly easy to use GUI for creating inno setup projects • Connection StringsNAnt -Automated BuildsCruise Control .NET - Frontend for automated builds

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2008
    Posts
    15

    Re: Stream reader next position

    But it doesnt work. I read in say 4 characters...process them..then do :
    srReader.Basestream.Position=1
    but it still reads starting at character 5

  4. #4

    Thread Starter
    New Member
    Join Date
    Feb 2008
    Posts
    15

    Re: Stream reader next position

    Solved it..... You have to use seek but before you set the seek position you have to use StreamReader.DiscardBufferedData() first !!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width