-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathProgram.cs
42 lines (37 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
39
40
41
42
using System;
using System.IO;
using System.Threading;
namespace ConsoleChromeSpeechProxy
{
class MainClass
{
private static App _mApp = null;
public static void Main(string[] args)
{
Console.WriteLine("App: {0}", AppDomain.CurrentDomain.FriendlyName);
Console.WriteLine("OSVersion: {0}", Environment.OSVersion.VersionString);
Server.SetAppName(AppDomain.CurrentDomain.FriendlyName);
if (args.Length > 0)
{
string strPort = args[0];
int port;
if (int.TryParse(strPort, out port))
{
Server.SetProxyPort(port);
}
}
string[] commandArgs = Environment.GetCommandLineArgs();
if (commandArgs.Length > 0)
{
FileInfo fi = new FileInfo(commandArgs[0]);
string installDir = fi.DirectoryName;
Server.SetInstallDirectory(installDir);
}
_mApp = new App();
while (_mApp.IsRunning())
{
Thread.Sleep(1);
}
}
}
}