public MyFolder GetSpecifiedFolder(string folderpath) { MyFolder myfolder = new MyFolder(); myfolder.Path = folderpath; DirectoryInfo di = new DirectoryInfo(folderpath); myfolder.Name = di.Name; myfolder.LastModified = di.LastWriteTimeUtc; DirectorySecurity sec = di.GetAccessControl(); myfolder.SecurityDesciptor = new Byte[sec.GetSecurityDescriptorBinaryForm().Length]; myfolder.SecurityDesciptor = sec.GetSecurityDescriptorBinaryForm(); return(myfolder); }
public MyFolder[] GetRootFolders() { List <MyFolder> myFolders = new List <MyFolder>(); MyFolder myfolder = new MyFolder(); myfolder.Path = this.path; DirectoryInfo di = new DirectoryInfo(path); myfolder.Name = di.Name; myfolder.LastModified = di.LastWriteTimeUtc; DirectorySecurity sec = di.GetAccessControl(); myfolder.SecurityDesciptor = new Byte[sec.GetSecurityDescriptorBinaryForm().Length]; myfolder.SecurityDesciptor = sec.GetSecurityDescriptorBinaryForm(); myFolders.Add(myfolder); return(myFolders.ToArray()); }
public MyFolder[] GetSubFolders(string parentFolderPath) { List <MyFolder> myFolders = new List <MyFolder>(); foreach (string dirpath in Directory.GetDirectories(parentFolderPath)) { MyFolder myfolder = new MyFolder(); myfolder.Path = dirpath; DirectoryInfo di = new DirectoryInfo(dirpath); myfolder.Name = di.Name; myfolder.LastModified = di.LastWriteTimeUtc; DirectorySecurity sec = di.GetAccessControl(); myfolder.SecurityDesciptor = new Byte[sec.GetSecurityDescriptorBinaryForm().Length]; myfolder.SecurityDesciptor = sec.GetSecurityDescriptorBinaryForm(); myFolders.Add(myfolder); } return(myFolders.ToArray()); }
public MyFolder GetSpecifiedFolder(string folderpath) { if (!Directory.Exists(folderpath)) { throw new Microsoft.BusinessData.Runtime.ObjectNotFoundException(String.Format( "No folder exists at the path {0}", folderpath)); } MyFolder myfolder = new MyFolder(); myfolder.Path = folderpath; DirectoryInfo di = new DirectoryInfo(folderpath); myfolder.Name = di.Name; myfolder.LastModified = di.LastWriteTimeUtc; DirectorySecurity sec = di.GetAccessControl(); myfolder.SecurityDescriptor = new Byte[sec.GetSecurityDescriptorBinaryForm().Length]; myfolder.SecurityDescriptor = sec.GetSecurityDescriptorBinaryForm(); return(myfolder); }
public MyFolder GetSpecifiedFolder(string folderpath) { if (!Directory.Exists(folderpath)) { throw new Microsoft.BusinessData.Runtime.ObjectNotFoundException(String.Format( "No folder exists at the path {0}", folderpath)); } MyFolder myfolder = new MyFolder(); myfolder.Path = folderpath; DirectoryInfo di = new DirectoryInfo(folderpath); myfolder.Name = di.Name; myfolder.LastModified = di.LastWriteTimeUtc; DirectorySecurity sec = di.GetAccessControl(); myfolder.SecurityDescriptor = new Byte[sec.GetSecurityDescriptorBinaryForm().Length]; myfolder.SecurityDescriptor = sec.GetSecurityDescriptorBinaryForm(); return myfolder; }
public MyFolder[] GetFolders(string parentFolderPath) { List<MyFolder> myFolders = new List<MyFolder>(); foreach (string dirpath in Directory.GetDirectories(parentFolderPath)) { MyFolder myfolder = new MyFolder(); myfolder.Path = dirpath; DirectoryInfo di = new DirectoryInfo(dirpath); myfolder.Name = di.Name; myfolder.LastModified = di.LastWriteTimeUtc; DirectorySecurity sec = di.GetAccessControl(); myfolder.SecurityDescriptor = new Byte[sec.GetSecurityDescriptorBinaryForm().Length]; myfolder.SecurityDescriptor = sec.GetSecurityDescriptorBinaryForm(); myFolders.Add(myfolder); } return myFolders.ToArray(); }