-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
68 lines (62 loc) · 2.69 KB
/
Copy pathProgram.cs
File metadata and controls
68 lines (62 loc) · 2.69 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using Avalonia;
using Serilog;
using System;
using QuestPDF.Infrastructure;
namespace AHON_TRACK
{
internal sealed class Program
{
// Initialization code. Don't use any Avalonia, third-party APIs or any
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
// yet and stuff might break.
[STAThread]
public static void Main(string[] args)
{
// 🔥 TEMPORARY CODE - Run once to get password hash, then DELETE! 🔥
try
{
string password = "Calubayan123";
string hash = BCrypt.Net.BCrypt.HashPassword(password);
Console.WriteLine("================================");
Console.WriteLine("PASSWORD HASH GENERATOR");
Console.WriteLine("================================");
Console.WriteLine($"Plain Password: {password}");
Console.WriteLine($"\nHashed Password:");
Console.WriteLine(hash);
Console.WriteLine("\n================================");
Console.WriteLine("Copy the hash above and use it in your SQL INSERT!");
Console.WriteLine("================================\n");
// Also write to debug output (visible in Visual Studio Output window)
System.Diagnostics.Debug.WriteLine("================================");
System.Diagnostics.Debug.WriteLine($"Hashed Password: {hash}");
System.Diagnostics.Debug.WriteLine("================================");
}
catch (Exception ex)
{
Console.WriteLine($"Error hashing password: {ex.Message}");
}
// 🔥 END TEMPORARY CODE 🔥
try
{
QuestPDF.Settings.License = LicenseType.Community;
BuildAvaloniaApp()
.StartWithClassicDesktopLifetime(args);
}
catch (Exception e)
{
var serviceProvider = new ServiceProvider();
var logger = serviceProvider.GetService<ILogger>();
logger.Fatal(e, "An unhandled exception occurred during bootstrapping the application.");
}
}
// Avalonia configuration, don't remove; also used by visual designer.
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithInterFont()
.LogToTrace().With(new SkiaOptions()
{
MaxGpuResourceSizeBytes = 2000000000, // 2 GB of GPU memory
});
}
}