From 2ea36fe8a0c12620f2076f2ba87328e4b7bc345c Mon Sep 17 00:00:00 2001 From: Alexander Date: Sat, 24 Dec 2022 12:15:13 +0300 Subject: [PATCH] 20221224 --- anbs_cp/Classes/FileExtensions.cs | 12 ++++++++++++ anbs_cp/anbs_cp.csproj | 6 +++--- 2 files changed, 15 insertions(+), 3 deletions(-) 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