Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using MyCloud.Models;
- namespace MyCloud.Helpers
- {
- public static class GetFilesHelper
- {
- public static List<FileData> GetUserFiles(string path)
- {
- var directory = new DirectoryInfo(path);
- List<FileData> returnFiles = new List<FileData>();
- var files = directory.GetFiles();
- foreach(var file in files)
- {
- FileData toAdd = new FileData();
- toAdd.FileName = file.Name;
- toAdd.Path = file.ToString();
- toAdd.Weight = file.Length;
- toAdd.CreateDate = file.LastAccessTime;
- toAdd.AllMemory = file.Length;
- returnFiles.Add(toAdd);
- }
- return returnFiles;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement