-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
40 lines (37 loc) · 1.13 KB
/
Program.cs
File metadata and controls
40 lines (37 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using System.Diagnostics;
using System.Security.Principal;
using System.Windows.Forms;
using SQLUserForge.Forms;
using SQLUserForge.Services;
namespace SQLUserForge
{
internal static class Program
{
[STAThread]
static void Main()
{
// Auto-élévation admin (tu l’avais déjà)
bool isAdmin = new WindowsPrincipal(WindowsIdentity.GetCurrent())
.IsInRole(WindowsBuiltInRole.Administrator);
if (!isAdmin)
{
try
{
Process.Start(new ProcessStartInfo
{
FileName = Application.ExecutablePath,
UseShellExecute = true,
Verb = "runas"
});
}
catch { /* UAC refusé */ }
return;
}
// Initialisation UI et traductions
ApplicationConfiguration.Initialize();
TranslationProvider.Initialize(); // charge config.json + lang courant
Application.Run(new MainForm());
}
}
}