Пример #1
0
        private FileModel CreateFileModel(string path, long size)
        {
            var model = new FileModel();

            model.Name = Path.GetFileName(path);
            model.Path = Path.GetFullPath(path);
            model.Hash = CryptographyProvider.Encode(File.ReadAllBytes(path));
            model.Size = SizeConverter.ConvertBytesToMegaBytes(size);

            return(model);
        }