/*** 文件资源管理器定位操作类 Austin Liu 刘恒辉 Project Manager and Software Designer E-Mail: lzhdim@163.com Blog: http://lzhdim.cnblogs.com Date: 2024-01-15 15:18:00 使用方法例子: OpenInExplorerUtil.OpenFileInExplorer(Application.ExecutablePath()); ***/ namespace Lzhdim.LPF.Utility { using System.Diagnostics; /// <summary> /// 文件资源管理器定位操作类 /// </summary> public sealed class OpenInExplorerUtil { /// <summary> /// 用文件资源管理器定位文件 /// </summary> /// <param name="filePath">文件路径</param> public static void OpenFile(string filePath) { Process.Start("explorer.exe", $"/select, \"{filePath}\""); } /// <summary> /// 用文件资源管理器定位文件夹 /// </summary> /// <param name="folderPath">文件夹路径</param> public static void OpenFolder(string folderPath) { Process.Start("explorer.exe", folderPath); } } }
![]() |
Austin Liu 刘恒辉
Project Manager and Software Designer E-Mail:lzhdim@163.com Blog:https://lzhdim.cnblogs.com 欢迎收藏和转载此博客中的博文,但是请注明出处,给笔者一个与大家交流的空间。谢谢大家。 |