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. Locking files

Locking files

Scheduled Pinned Locked Moved C#
question
4 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.
  • M Offline
    M Offline
    my4color
    wrote on last edited by
    #1

    I have a typical need in which I want to lock a file so that no software can access it, not even copy it. Any ideas as to how I can do this? TIA

    M 1 Reply Last reply
    0
    • M my4color

      I have a typical need in which I want to lock a file so that no software can access it, not even copy it. Any ideas as to how I can do this? TIA

      M Offline
      M Offline
      Michael Sync
      wrote on last edited by
      #2

      I think you just need to open this file from your program. then, no software can access it until you close this file from your program.

      Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) "Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."

      R 1 Reply Last reply
      0
      • M Michael Sync

        I think you just need to open this file from your program. then, no software can access it until you close this file from your program.

        Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) "Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."

        R Offline
        R Offline
        Rahul RK
        wrote on last edited by
        #3

        But still we can copy that file.. Michael is right that if we open file through program no one can access it but it can be copied... rahul kulkarni

        M 1 Reply Last reply
        0
        • R Rahul RK

          But still we can copy that file.. Michael is right that if we open file through program no one can access it but it can be copied... rahul kulkarni

          M Offline
          M Offline
          mav northwind
          wrote on last edited by
          #4

          Not true. You can open the file in a way that denies other processes read and write access, so it can't be read for copying. The problem is as soon as your program ends or gets killed, the file is free-for-all again.

          Regards, mav -- Black holes are the places where God divided by 0...

          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