-
Notifications
You must be signed in to change notification settings - Fork 2
/
Program.cs
38 lines (34 loc) · 1.15 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.IO;
namespace support_conversation_converter
{
class Program
{
static void Main(string[] args)
{
if (args.Length <= 0) {
Console.WriteLine("Drag and drop a text file or a text-based support binary (for Fire Emblem: Three Houses) on this executable.");
Console.ReadKey();
Environment.Exit(-1);
}
string filepath = Path.GetFullPath(Convert.ToString(args[0]));
if (!File.Exists(filepath)) {
Console.WriteLine("Please provide a filepath to an existing file.");
Console.ReadKey();
Environment.Exit(-1);
}
switch (Path.GetExtension(filepath))
{
case ".txt":
Converter.TextToBinary(filepath);
break;
case ".bin":
Converter.BinaryToText(filepath);
break;
default:
Console.WriteLine("Please provide a valid file format (*.txt, *.bin).");
break;
}
}
}
}