diff --git a/anbs_cp/Classes/FileExtensions.cs b/anbs_cp/Classes/FileExtensions.cs index 87ae1ef..a0b278a 100644 --- a/anbs_cp/Classes/FileExtensions.cs +++ b/anbs_cp/Classes/FileExtensions.cs @@ -66,4 +66,16 @@ public static class FileExtension /// MIME-тип файла public static string MIMEType (IFormFile file) => file.ContentType; + + /// + /// Размер файла в байтах + /// + /// Полное имя и путь к файлу + /// Размер файла в байтах + public static long FileSize(string fileName) + { + FileInfo fileInfo = new (fileName); + + return fileInfo.Length; + } } \ No newline at end of file diff --git a/anbs_cp/anbs_cp.csproj b/anbs_cp/anbs_cp.csproj index 2629cda..e1ecddc 100644 --- a/anbs_cp/anbs_cp.csproj +++ b/anbs_cp/anbs_cp.csproj @@ -2,7 +2,7 @@ net7.0 - 2022.1203.3 + 2022.1224.0 Alexander Babaev ANB Software Components Pack Library of some useful functions in C# language. @@ -15,8 +15,8 @@ True https://git.babaev-an.ru/babaev-an/anbsoftware_componentspack https://git.babaev-an.ru/babaev-an/anbsoftware_componentspack - 2022.1203.3 - 2022.1203.3 + 2022.1224.0 + 2022.1224.0 ANBSoftware.ComponentsPack MIT 6.0