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. Need help in file hanling

Need help in file hanling

Scheduled Pinned Locked Moved C#
csharphelptutorial
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.
  • A Offline
    A Offline
    Ashraj1982
    wrote on last edited by
    #1

    Hi, Can any one plz tell me how to check for end of file and reading each line to buffer. while(!feof(fp)) { string = fgets(buffer,85,fp); // Read each line from the file } The above code in c#.

    N A 2 Replies Last reply
    0
    • A Ashraj1982

      Hi, Can any one plz tell me how to check for end of file and reading each line to buffer. while(!feof(fp)) { string = fgets(buffer,85,fp); // Read each line from the file } The above code in c#.

      N Offline
      N Offline
      NaNg15241
      wrote on last edited by
      #2

      do a new StreamReader of the stream, and use the property .EndOfStream to check if file is in the end, and method .ReadLine() to read line.

      1 Reply Last reply
      0
      • A Ashraj1982

        Hi, Can any one plz tell me how to check for end of file and reading each line to buffer. while(!feof(fp)) { string = fgets(buffer,85,fp); // Read each line from the file } The above code in c#.

        A Offline
        A Offline
        alexey N
        wrote on last edited by
        #3

        If you're using framework 2.0 the most simple method is string[] File.ReadAllLines(string path) If using framework 1.1 then read NaNg15241 reply Best regards, Alexey.

        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