Esatto.Win32.Common
3.0.3
See the version list below for details.
dotnet add package Esatto.Win32.Common --version 3.0.3
NuGet\Install-Package Esatto.Win32.Common -Version 3.0.3
<PackageReference Include="Esatto.Win32.Common" Version="3.0.3" />
paket add Esatto.Win32.Common --version 3.0.3
#r "nuget: Esatto.Win32.Common, 3.0.3"
// Install Esatto.Win32.Common as a Cake Addin #addin nuget:?package=Esatto.Win32.Common&version=3.0.3 // Install Esatto.Win32.Common as a Cake Tool #tool nuget:?package=Esatto.Win32.Common&version=3.0.3
Esatto Win32 Common
- Process and Job objects
- Create Job
- Create process in other session
- Privilege manipulation
- Printers
- Creating RAW Print Jobs
- Installing and administering Port Monitors
- Installing Printer Drivers
- Installing and administering NT Services
- Windows Security access
- Computer and user names (FQDN, UPN, etc...) without LDAP
- Standard windows Username/Password prompt
- Standard windows Certificate prompt
- Mapping a network drive with or without a drive letter
- Setting a file's Mark-of-the-web
Create Job
Ensures that even if you crash or things go wrong, child processes will not be left around.
using (var job = new Job())
{
var child = Process.Start(/* blah */);
// small opportunity between Process.Start and job.AddProcess. Use
// CREATE_SUSPENDED to avoid the bug
job.AddProcess(child);
throw new InvalidOperationException("Example");
}
// since Job.Dispose was called, the child process was terminated by the OS
Create process in other session
While running as a user with rights to SE_TCB_NAME
(typically SYSTEM
), you
can create a process in a different user's session with CreateProcessForSession
.
var otherUserSession = /* Get another user's session ID */;
ProcessInterop.CreateProcessForSession(otherUserSession, "calc.exe", "");
Privilege manipulation
To run a piece of code with privileges
var privs = new[]
{
Privilege.TrustedComputingBase,
Privilege.AssignPrimaryToken,
Privilege.IncreaseQuota
};
Privilege.RunWithPrivileges(() =>
{
Console.WriteLine("I got the power!");
}, privs);
Write RAW Print job
To send RAW data to a windows print queue, as frequently required for thermal label printers.
using (var windowsJob = new GdiPrintJob("Zebra TLP384", GdiPrintJobDataType.Raw, "Example Job Name", null))
{
var exampleLabelData = new MemoryStream(Encoding.ASCII.GetBytes(@"^XA
^LT120
^FX Top section
^CFB,25
^FO50,173^FDFROM:^FS
^FO200,173^FDTest sender^FS
^FO200,228^FD10 MOUNTAIN PKWY^FS
^FO200,283^FDTN, COLLIERVILLE, 38017^FS
^FO50,343^GB706,1,3^FS
^XZ"));
windowsJob.WritePage(exampleLabelData);
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- No dependencies.
-
net7.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Esatto.Win32.Common:
Package | Downloads |
---|---|
Itp.WpfScanners
Keyboard-like incorporation of barcode scanners into WPF applications. Support for Serial and HID barcode scanners. |
GitHub repositories
This package is not used by any popular GitHub repositories.