Brows.Win32.Interop
1.0.0
See the version list below for details.
dotnet add package Brows.Win32.Interop --version 1.0.0
NuGet\Install-Package Brows.Win32.Interop -Version 1.0.0
<PackageReference Include="Brows.Win32.Interop" Version="1.0.0" />
<PackageVersion Include="Brows.Win32.Interop" Version="1.0.0" />
<PackageReference Include="Brows.Win32.Interop" />
paket add Brows.Win32.Interop --version 1.0.0
#r "nuget: Brows.Win32.Interop, 1.0.0"
#:package Brows.Win32.Interop@1.0.0
#addin nuget:?package=Brows.Win32.Interop&version=1.0.0
#tool nuget:?package=Brows.Win32.Interop&version=1.0.0
Brows.Win32.Interop
Windows Shell and file-system interop for .NET. This package provides higher-level services for Shell execution, shortcut resolution, and file identity checks, plus lower-level Win32 and COM bindings used by other Brows packages.
Install
dotnet add package Brows.Win32.Interop
The package targets .NET Framework 4.6.2 and 4.8, and .NET 8 and 10 on Windows. It calls Windows APIs and must run on Windows.
Use the services
using Brows.Win32;
using System.Threading;
string firstPath = @"C:\Data\report.txt";
string secondPath = @"C:\Data\report-link.txt";
string directoryPath = @"C:\Data";
string documentPath = firstPath;
string shortcutPath = @"C:\Data\report.lnk";
using var kernel = new Win32KernelService();
bool sameFile = kernel.PathsAreEquivalent(firstPath, secondPath);
bool caseSensitive = kernel.PathIsCaseSensitive(directoryPath);
using var shell = new Win32ShellService(threadPool: null);
await shell.ExecuteDefault(documentPath, CancellationToken.None);
string targetPath = await shell.GetLinkPath(shortcutPath, CancellationToken.None);
PathsAreEquivalent compares the identity of existing files or directories, rather than their path text. PathIsCaseSensitive queries a directory's case-sensitivity flag and returns false when the query is unsupported. Other query failures throw.
ExecuteDefault runs the default Shell verb for a path. Its overload ExecuteDefault(file, with, cancellationToken) opens file with the specified executable. ExecuteProperties opens the Properties verb. These methods return Task; await them to observe errors. Shell work runs on an STA worker. An optional cancellation token can stop work before dispatch, but cannot interrupt a native Shell call already in progress.
GetLinkPath resolves a .lnk shortcut and returns its target path, or null for a non-shortcut or a lookup failure. Cancellation is propagated. Win32ShellService can use a supplied Brows.Threading.STAThreadPool; passing null creates a pool owned by the service. Dispose the service after its operations finish.
License
MIT.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0-windows7.0 is compatible. net9.0-windows was computed. net10.0-windows was computed. net10.0-windows7.0 is compatible. |
| .NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
-
.NETFramework 4.6.2
- Brows.Win32.STAThreadPool (>= 1.2.2)
- Domore.Logs (>= 10.6.4)
- Microsoft.CSharp (>= 4.7.0)
-
.NETFramework 4.8
- Brows.Win32.STAThreadPool (>= 1.2.2)
- Domore.Logs (>= 10.6.4)
- Microsoft.CSharp (>= 4.7.0)
-
net10.0-windows7.0
- Brows.Win32.STAThreadPool (>= 1.2.2)
- Domore.Logs (>= 10.6.4)
-
net8.0-windows7.0
- Brows.Win32.STAThreadPool (>= 1.2.2)
- Domore.Logs (>= 10.6.4)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Brows.Win32.Interop:
| Package | Downloads |
|---|---|
|
Brows.Win32.Interop.Operations
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.