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. Set File Access (Read/ReadWrite/Write)

Set File Access (Read/ReadWrite/Write)

Scheduled Pinned Locked Moved C#
csharpquestion
3 Posts 2 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
    M 2000
    wrote on last edited by
    #1

    Hi I want to set the File Access (e.g. FileAccess.Read ) attribute in my C# program. I found the System.IO.File.SetAttributes() Function but it seems not to be the right thing. I also do not want to use the FileStream constructor. Is there another way? Thanks

    T 1 Reply Last reply
    0
    • M M 2000

      Hi I want to set the File Access (e.g. FileAccess.Read ) attribute in my C# program. I found the System.IO.File.SetAttributes() Function but it seems not to be the right thing. I also do not want to use the FileStream constructor. Is there another way? Thanks

      T Offline
      T Offline
      Tom Larsen
      wrote on last edited by
      #2

      Can you be more descriptive on what "it seems not to be the right thing" means? Keep in mind these are just access level permissions. NTFS will have another level that will alter the behavior.

      M 1 Reply Last reply
      0
      • T Tom Larsen

        Can you be more descriptive on what "it seems not to be the right thing" means? Keep in mind these are just access level permissions. NTFS will have another level that will alter the behavior.

        M Offline
        M Offline
        M 2000
        wrote on last edited by
        #3

        I work with a file in my program. But I want to avoid that the file is modified outside of my application by another user. So I thought to make it write protected would be a solution. Do you have another recommendation? Thanks!

        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