#1
  1. Some day I will be a Lambda!
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Location
    NJ
    Posts
    18
    Rep Power
    0

    Question Creating a folder in C#


    I can create a new folder in C# in which I load files that are needed. The problem is, is that I need to make this folder have a System, Hidden attribute. The code that I'm using right now is as follows...

    foreach (string s in Directory.GetLogicalDrives())
    {
    ...
    Find the drive I'm looking for
    ...
    DirectoryInfo r = new DirectoryInfo(s);
    r.CreateSubdirectory("MyFolder");
    }

    I would appreciate any help. Thank you.

    Eric
    :confused:
  2. #2
  3. SwollenMember
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    the master control
    Posts
    264
    Rep Power
    14
    if you use a FileSystemWatcher object, then you can set the permissions for a given directory. it has a NotifyFilters property that allows you to set attributes for the directory.

IMN logo majestic logo threadwatch logo seochat tools logo