forked from MythicalLTD/Pterodactyl-Desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
38 lines (33 loc) · 1.16 KB
/
Program.cs
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
using System;
using System.Linq;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace PteroController
{
internal static class Program
{
public static string appversion = "0.0.3";
[DllImport("kernel32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool AttachConsole(int dwProcessId);
private const int ATTACH_PARENT_PROCESS = -1;
[STAThread]
static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
//EXAMPLE OF A CLI COMMAND
if (args.Contains("-version"))
{
AttachConsole(ATTACH_PARENT_PROCESS);
Console.Title = "PteroController | CLI";
Console.WriteLine("@echo off");
Console.Clear();
Console.WriteLine("PteroController version " + appversion + " by MythicalSystems");
Console.WriteLine("");
Console.WriteLine("Press any key to exit");
}
Application.Run(new FrmLogin());
}
}
}