forked from hyperzlib/FastResampler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
46 lines (45 loc) · 1.48 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
39
40
41
42
43
44
45
46
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Threading;
namespace FastResampler
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] argv)
{
Console.Clear();
if (argv.Length == 1)
{
Utils.tempTitle2 = argv[0];
Console.Title = Utils.tempTitle;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
try
{
Application.Run(new Form1());
}
catch (Exception e)
{
Utils.log("error: " + string.Format("{0}, {1}", e.Message, e.StackTrace));
}
}
else
{
EventWaitHandle _mainWaitHandle = new AutoResetEvent(false);
Console.Title = Utils.tempTitle;
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = Application.ExecutablePath;
process.StartInfo.WorkingDirectory = System.Environment.CurrentDirectory;
process.StartInfo.Arguments = string.Format("\"{0}\"", Utils.tempTitle);
process.Start();
Console.ReadLine();
}
}
}
}