Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Read dynamic textstream

Read dynamic textstream

Scheduled Pinned Locked Moved C#
question
4 Posts 4 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hello forum, I want to display the input of a logfile in a textbox. The difficulty is that the logfile grows and the content of the textbox should also display the new entries in realtime. I do not want to read the whole content of the logfile and display it in the textbox. What I am looking for is to read the stream till "readline = null" and then try to read every x seconds from that position on. Does anyone know if that is possible? Thanks in advance, MG

    S P A 3 Replies Last reply
    0
    • L Lost User

      Hello forum, I want to display the input of a logfile in a textbox. The difficulty is that the logfile grows and the content of the textbox should also display the new entries in realtime. I do not want to read the whole content of the logfile and display it in the textbox. What I am looking for is to read the stream till "readline = null" and then try to read every x seconds from that position on. Does anyone know if that is possible? Thanks in advance, MG

      S Offline
      S Offline
      Stefan Troschuetz
      wrote on last edited by
      #2

      I would recommend the usage of the FileSystemWatcher class, so that you only re-read your log file when it has changed instead of every x seonds. To prevent the reading of already retrieved text, store the Position property of your stream after every reading and then seek forward to this position when re-reading the log file.


      www.troschuetz.de

      1 Reply Last reply
      0
      • L Lost User

        Hello forum, I want to display the input of a logfile in a textbox. The difficulty is that the logfile grows and the content of the textbox should also display the new entries in realtime. I do not want to read the whole content of the logfile and display it in the textbox. What I am looking for is to read the stream till "readline = null" and then try to read every x seconds from that position on. Does anyone know if that is possible? Thanks in advance, MG

        P Offline
        P Offline
        Philip Fitzsimons
        wrote on last edited by
        #3

        http://www.codeproject.com/csharp/WinTail.asp[^]


        "When the only tool you have is a hammer, a sore thumb you will have."

        1 Reply Last reply
        0
        • L Lost User

          Hello forum, I want to display the input of a logfile in a textbox. The difficulty is that the logfile grows and the content of the textbox should also display the new entries in realtime. I do not want to read the whole content of the logfile and display it in the textbox. What I am looking for is to read the stream till "readline = null" and then try to read every x seconds from that position on. Does anyone know if that is possible? Thanks in advance, MG

          A Offline
          A Offline
          Anonymous
          wrote on last edited by
          #4

          Cool, thanks a lot!!

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups