From 9bfa70dc8db402f9a9d2ddfa1db8f9251a172f34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=85=BE=E7=8C=AB=E8=B7=83?= <1043137532@qq.com> Date: Mon, 4 May 2026 07:39:31 +0800 Subject: [PATCH] =?UTF-8?q?ref:=20DirectoryInfo=E3=80=81FileInfo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Shared/Utils/DirectoryUtils.cs | 5 +++++ Shared/Utils/FileUtils.cs | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/Shared/Utils/DirectoryUtils.cs b/Shared/Utils/DirectoryUtils.cs index 28ad04b..fdd24c7 100644 --- a/Shared/Utils/DirectoryUtils.cs +++ b/Shared/Utils/DirectoryUtils.cs @@ -15,4 +15,9 @@ public static class DirectoryUtils { /// public static bool Exists(string path) => Directory.Exists(PathUtils.ToLongPath(path)); + /// + /// 创建 对象。 + /// + public static DirectoryInfo GetInfo(string path) => new(PathUtils.ToLongPath(path)); + } diff --git a/Shared/Utils/FileUtils.cs b/Shared/Utils/FileUtils.cs index ad723ee..76fe8db 100644 --- a/Shared/Utils/FileUtils.cs +++ b/Shared/Utils/FileUtils.cs @@ -45,4 +45,9 @@ public static class FileUtils { /// public static bool Exists(string filePath) => File.Exists(PathUtils.ToLongPath(filePath)); + /// + /// 创建 对象。 + /// + public static FileInfo GetInfo(string path) => new(PathUtils.ToLongPath(path)); + }