PathEngine 1.1.6

dotnet add package PathEngine --version 1.1.6                
NuGet\Install-Package PathEngine -Version 1.1.6                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PathEngine" Version="1.1.6" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PathEngine --version 1.1.6                
#r "nuget: PathEngine, 1.1.6"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install PathEngine as a Cake Addin
#addin nuget:?package=PathEngine&version=1.1.6

// Install PathEngine as a Cake Tool
#tool nuget:?package=PathEngine&version=1.1.6                

PathEngine

Almighty Path Parser | 全能路径解析器


功能:

读取

  • 解析路径
PathResolver.Instance.Get("%ProgramFiles(x86)%");
//C:\Program Files (x86)
PathResolver.Instance.Get(@"HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}");
//HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}
PathResolver.Instance.Get("TestProject.Configs.config.txt");
//TestProject.Configs.config.txt

  • 文件/子项搜索
//文件目录
PathResolver.Instance.List(@"path_list:\%ProgramData%\*\*\*.txt");
//C:\ProgramData\chocolatey\bin\_processed.txt
//...
//C:\ProgramData\NVIDIA Corporation\NvStreamSrv\settings.txt

//注册表目录
PathResolver.Instance.List(@"path_list:\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\*");
//HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\:Enable64Bit
...
//HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\:DbgJITDebugLaunchSetting
  • 目录搜索

注意:搜索目录一定要以\结尾

// 文件目录
PathResolver.Instance.List(@"path_list:\%ProgramData%\Microsoft\VisualStudio\Packages\Microsoft.CodeAnalysis*\");
//C:\ProgramData\Microsoft\VisualStudio\Packages\Microsoft.CodeAnalysis.Compilers,version=4.2.0.2228105,productarch=neutral
//...
//C:\ProgramData\Microsoft\VisualStudio\Packages\Microsoft.CodeAnalysis.VisualStudio.Setup.Resources,version=15.9.28218.60,language=zh-CN

//注册表目录
PathResolver.Instance.List(@"path_list:\HKEY_LOCAL_MACHINE\SOFTWARE\win*\");
//HKEY_LOCAL_MACHINE\SOFTWARE\Windows
  • 获取内容
//文件
PathResolver.Instance.Get(@"path_content:\Configs\config.txt");
//注册表
PathResolver.Instance.Get(@"path_content:\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}:pv");
//嵌入资源
var res3 = PathResolver.Instance.Get(@"path_content:\Configs.config.txt");
  • 获取文件版本号
var res = PathResolver.Instance.Get(@$"version:\C:\Windows\System32\cmd.exe");
//10.0.19041.1826 (WinBuild.160101.0800)

写入

//设置注册表项
PathResolver.Instance.Set(@"content:\HKEY_LOCAL_MACHINE\SOFTWARE\MyApp:key", "1");
PathResolver.Instance.Set(@"HKEY_LOCAL_MACHINE\SOFTWARE\MyApp:key2", 2);

更多示例

Library:

Install-Package PathEngine -Version

https://www.nuget.org/packages/PathEngine/

CLI:

todo

Product Compatible and additional computed target framework versions.
.NET net6.0-windows7.0 is compatible.  net7.0-windows was computed.  net8.0-windows was computed. 
.NET Framework net46 is compatible.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.6 430 8/18/2022
1.1.4 402 8/8/2022
1.0.2 391 8/1/2022
1.0.1 396 7/29/2022
1.0.0 411 7/29/2022