Thursday, May 13, 2010

How to Create Hidden folders using c#

using System.IO; 
// folder path that you want to create
string path = @"c:\createfolder\NewFolder"; 
if (!Directory.Exists(path)) 
{ 
  // Creating folder 
  DirectoryInfo di = Directory.CreateDirectory(path); 
  // setting attributes
  di.Attributes = FileAttributes.Directory | FileAttributes.Hidden; 
}

No comments:

Post a Comment