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. Help Me with "Directory"

Help Me with "Directory"

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

    When I want my file to be hidden, I simply use this System.IO.File.SetAttributes(str filepath, FileAttributes.Hidden) . But what about Directory, How can I set my directory to be hidden, I dont find any SetAttributes method for directory ! Any helps ???

    D M 2 Replies Last reply
    0
    • H hackerhcm

      When I want my file to be hidden, I simply use this System.IO.File.SetAttributes(str filepath, FileAttributes.Hidden) . But what about Directory, How can I set my directory to be hidden, I dont find any SetAttributes method for directory ! Any helps ???

      D Offline
      D Offline
      DigitalKing
      wrote on last edited by
      #2

      DirectoryInfo d = new DirectoryInfo(@"path\to\your\directory");
      d.Attributes |= FileAttributes.Hidden;

      H 1 Reply Last reply
      0
      • H hackerhcm

        When I want my file to be hidden, I simply use this System.IO.File.SetAttributes(str filepath, FileAttributes.Hidden) . But what about Directory, How can I set my directory to be hidden, I dont find any SetAttributes method for directory ! Any helps ???

        M Offline
        M Offline
        Maqsood Ahmed
        wrote on last edited by
        #3

        Hello, Use DirectoryInfo class's Attributes property. HTH, Cheers :) Maqsood Ahmed - MCAD.net Kolachi Advanced Technologies http://www.kolachi.net

        1 Reply Last reply
        0
        • D DigitalKing

          DirectoryInfo d = new DirectoryInfo(@"path\to\your\directory");
          d.Attributes |= FileAttributes.Hidden;

          H Offline
          H Offline
          hackerhcm
          wrote on last edited by
          #4

          Great ... It works ! Thank you !

          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