Results 1 to 3 of 3

Thread: lines in a stream

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2003
    Location
    When?!?!
    Posts
    108

    lines in a stream

    I am trying to create an error trapper for my application. but for the part where I want it to log the error to a stream, I need to know how many lines are in the stream input so I write at the right place. basicly I want to count lines in a stream. any suggestions?
    DannyJoumaa
    Advanced VB6 Programmer
    Intermediate-Advanced VB .NET Programmer
    Intermediate C# Programmer
    Intermediate Win32 Developer
    Beginner Mac OS X Developer
    Contact: [email protected]

    Favorite Sayings:
    "Every time you open your mouth, you prove your an idiot."
    "God is a programmer. Satan is a bug. Life is debugging."

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Aug 2003
    Location
    When?!?!
    Posts
    108
    pllleeeaaase help me out
    DannyJoumaa
    Advanced VB6 Programmer
    Intermediate-Advanced VB .NET Programmer
    Intermediate C# Programmer
    Intermediate Win32 Developer
    Beginner Mac OS X Developer
    Contact: [email protected]

    Favorite Sayings:
    "Every time you open your mouth, you prove your an idiot."
    "God is a programmer. Satan is a bug. Life is debugging."

  3. #3
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142
    if you want to count the lines in a Stream , you need to split the Stream by it's returns, eg:
    VB Code:
    1. [COLOR=blue]Dim[/COLOR] x [COLOR=blue]As Integer[/COLOR] = streamname.ReadToEnd().Split(Environment.NewLine).GetUpperBound(0)
    ~
    if a post is resolved, please mark it as [Resolved]
    protected string get_Signature(){return Censored;}
    [vbcode][php] please use code tags when posting any code [/php][/vbcode]

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