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. C# read and write log file

C# read and write log file

Scheduled Pinned Locked Moved C#
csharptutorialquestion
3 Posts 3 Posters 0 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.
  • S Offline
    S Offline
    sc steinhayse
    wrote on last edited by
    #1

    I would like to know how to accomplish the following goals in C#: 1. In an existing C# 2008 application, I would like to create two separate log files. a. The first log file would write out data in a fixed file format prferably to a text file. A new C# 2010 desktop and/or console application would be written to read this file and do furher processing. b. The second log file would be written to display any messages generated by the console application and/or messages that are generated by a web service the console application calls. Can you show me how to create these two log files? 2. A new C# 2010 desktop and/or console application will be written to process the information contained with the log file produced in a fixed file format in step 1a. listed above. Can you show me how to read the log file that is in a text file fixed format? Can you tell if the log file generated in a fixed file format should be generated in another format besides text? If so, what format should be used and can you tell me how to read the data in this alternative file format?

    P A 2 Replies Last reply
    0
    • S sc steinhayse

      I would like to know how to accomplish the following goals in C#: 1. In an existing C# 2008 application, I would like to create two separate log files. a. The first log file would write out data in a fixed file format prferably to a text file. A new C# 2010 desktop and/or console application would be written to read this file and do furher processing. b. The second log file would be written to display any messages generated by the console application and/or messages that are generated by a web service the console application calls. Can you show me how to create these two log files? 2. A new C# 2010 desktop and/or console application will be written to process the information contained with the log file produced in a fixed file format in step 1a. listed above. Can you show me how to read the log file that is in a text file fixed format? Can you tell if the log file generated in a fixed file format should be generated in another format besides text? If so, what format should be used and can you tell me how to read the data in this alternative file format?

      P Offline
      P Offline
      Paul Conrad
      wrote on last edited by
      #2

      sc steinhayse wrote:

      Can you tell if the log file generated in a fixed file format should be generated in another format besides text?

      No, plain old text format will be sufficient.

      sc steinhayse wrote:

      Can you show me how to read the log file that is in a text file fixed format?

      A google search on basic file I/O in C# would be a good starting place.

      "Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus

      1 Reply Last reply
      0
      • S sc steinhayse

        I would like to know how to accomplish the following goals in C#: 1. In an existing C# 2008 application, I would like to create two separate log files. a. The first log file would write out data in a fixed file format prferably to a text file. A new C# 2010 desktop and/or console application would be written to read this file and do furher processing. b. The second log file would be written to display any messages generated by the console application and/or messages that are generated by a web service the console application calls. Can you show me how to create these two log files? 2. A new C# 2010 desktop and/or console application will be written to process the information contained with the log file produced in a fixed file format in step 1a. listed above. Can you show me how to read the log file that is in a text file fixed format? Can you tell if the log file generated in a fixed file format should be generated in another format besides text? If so, what format should be used and can you tell me how to read the data in this alternative file format?

        A Offline
        A Offline
        Abhinav S
        wrote on last edited by
        #3

        You can use Log4Net to generate a log for an application. Go through their documentation to figure out how to use it.

        Windows Phone Apps - Dilbert | Speed Dial

        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