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. direct access to file memory

direct access to file memory

Scheduled Pinned Locked Moved C#
csharpperformance
6 Posts 4 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
    sahandshokri
    wrote on last edited by
    #1

    i want to know how i can access to sectors used by typical file to read and write directly them in c# and i need the methods that read and write hard disk sectors directly thanks

    0 D 2 Replies Last reply
    0
    • S sahandshokri

      i want to know how i can access to sectors used by typical file to read and write directly them in c# and i need the methods that read and write hard disk sectors directly thanks

      0 Offline
      0 Offline
      0x3c0
      wrote on last edited by
      #2

      Use PInvoke. OpenFile(@"\\.\A:", ...), where A: is the drive you want to read. SetFilePointer(startSector). ReadFile(512*numberOfSectors)

      Between the idea And the reality Between the motion And the act Falls the Shadow

      1 Reply Last reply
      0
      • S sahandshokri

        i want to know how i can access to sectors used by typical file to read and write directly them in c# and i need the methods that read and write hard disk sectors directly thanks

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        Why would you need to do this??

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

        M 1 Reply Last reply
        0
        • D Dave Kreskowiak

          Why would you need to do this??

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008

          M Offline
          M Offline
          Mark Brend
          wrote on last edited by
          #4

          so what your saying is you don't know...

          D 1 Reply Last reply
          0
          • M Mark Brend

            so what your saying is you don't know...

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            Yes, I do know how to read/write disk sectors. No, I have no idea why he would want to do this.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007, 2008
            But no longer in 2009...

            M 1 Reply Last reply
            0
            • D Dave Kreskowiak

              Yes, I do know how to read/write disk sectors. No, I have no idea why he would want to do this.

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                   2006, 2007, 2008
              But no longer in 2009...

              M Offline
              M Offline
              Mark Brend
              wrote on last edited by
              #6

              well I do not know why he would want to read / write directly to the FAT / NTFS but I would like to tag files with extra infomation, that my compnay would find helpful... so if you know how Ican do this from c# then that would be handy. :)

              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