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. Attributes of Directory ??

Attributes of Directory ??

Scheduled Pinned Locked Moved C#
tutorialquestion
5 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.
  • N Offline
    N Offline
    Neo Andreson
    wrote on last edited by
    #1

    How to check Attributes of any Directory like ReadOnly Property??

    Truth Is The Simplest !!!!

    G L 2 Replies Last reply
    0
    • N Neo Andreson

      How to check Attributes of any Directory like ReadOnly Property??

      Truth Is The Simplest !!!!

      G Offline
      G Offline
      Giorgi Dalakishvili
      wrote on last edited by
      #2

      Create an instance of DirectoryInfo class and check Attributes property.

      #region signature my articles #endregion

      1 Reply Last reply
      0
      • N Neo Andreson

        How to check Attributes of any Directory like ReadOnly Property??

        Truth Is The Simplest !!!!

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        FileAttributes fa = File.GetAttributes(@"c:\test.txt"); if(fa == FileAttributes.ReadOnly) { //... do something here... }

        N 1 Reply Last reply
        0
        • L Lost User

          FileAttributes fa = File.GetAttributes(@"c:\test.txt"); if(fa == FileAttributes.ReadOnly) { //... do something here... }

          N Offline
          N Offline
          Neo Andreson
          wrote on last edited by
          #4

          Thankxxxx but i am searching for Directory Attributes Readonly?? that means How to know Directory is writeprotected or Not??

          Truth Is The Simplest !!!!

          L 1 Reply Last reply
          0
          • N Neo Andreson

            Thankxxxx but i am searching for Directory Attributes Readonly?? that means How to know Directory is writeprotected or Not??

            Truth Is The Simplest !!!!

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            DirectoryInfo dirInfo = new DirectoryInfo(@"c:\temp");
            if (dirInfo.Attributes == FileAttributes.ReadOnly)
            {
            //...do something here...
            }

            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