1
1
using System ;
2
2
using System . IO ;
3
3
using System . Linq ;
4
+ using System . Reflection ;
4
5
using System . Runtime . InteropServices ;
5
6
using System . Threading . Tasks ;
6
7
using Colorful ;
24
25
using Texnomic . SecureDNS . Protocols ;
25
26
using Texnomic . SecureDNS . Terminal . Enums ;
26
27
using Texnomic . SecureDNS . Terminal . Options ;
27
- using Texnomic . SecureDNS . Terminal . Properties ;
28
28
29
29
using Console = Colorful . Console ;
30
30
using Protocol = Texnomic . SecureDNS . Terminal . Enums . Protocol ;
@@ -54,10 +54,26 @@ public static async Task Main(string[] Arguments)
54
54
await HostBuilder . RunConsoleAsync ( ) ;
55
55
}
56
56
57
+ private static byte [ ] ReadResource ( string Name )
58
+ {
59
+ var MainAssembly = Assembly . GetExecutingAssembly ( ) ;
60
+
61
+ var ResourceName = MainAssembly . GetManifestResourceNames ( )
62
+ . Single ( Resource => Resource . EndsWith ( Name ) ) ;
63
+
64
+ using var Stream = MainAssembly . GetManifestResourceStream ( ResourceName ) ;
65
+
66
+ var Buffer = new byte [ Stream . Length ] ;
67
+
68
+ Stream . Read ( Buffer ) ;
69
+
70
+ return Buffer ;
71
+ }
72
+
57
73
private static void BuildHost ( )
58
74
{
59
75
if ( ! File . Exists ( "AppSettings.json" ) )
60
- File . WriteAllBytes ( "AppSettings.json" , Resources . AppSettings ) ;
76
+ File . WriteAllBytes ( "AppSettings.json" , ReadResource ( " AppSettings.json" ) ) ;
61
77
62
78
HostBuilder = new HostBuilder ( )
63
79
. ConfigureAppConfiguration ( ConfigureApp )
@@ -84,7 +100,7 @@ private static void Splash()
84
100
{
85
101
Console . Title = "Texnomic SecureDNS" ;
86
102
87
- var Speed = new Figlet ( FigletFont . Load ( Resources . Speed ) ) ;
103
+ var Speed = new Figlet ( FigletFont . Load ( ReadResource ( " Speed.flf" ) ) ) ;
88
104
89
105
Console . WriteWithGradient ( Speed . ToAscii ( " Texnomic" ) . ConcreteValue . ToArray ( ) , System . Drawing . Color . Yellow , System . Drawing . Color . Fuchsia , 14 ) ;
90
106
@@ -99,7 +115,7 @@ private static void ConfigureApp(HostBuilderContext HostBuilderContext, IConfigu
99
115
}
100
116
private static void ConfigureLogging ( HostBuilderContext HostBuilderContext , ILoggingBuilder Logging )
101
117
{
102
- Logging . AddConsole ( ) ;
118
+ // Logging.AddConsole();
103
119
}
104
120
private static void ConfigureLogger ( HostBuilderContext HostBuilderContext , LoggerConfiguration LoggerConfiguration )
105
121
{
0 commit comments