-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
59 lines (44 loc) · 1.74 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
47
48
49
50
51
52
53
54
55
56
57
58
59
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Encodings.Parser;
namespace Encodings
{
class Program
{
static void Main(string[] args)
{
//logger
Log.ILogger Logger = Log.FileLogger.Instance;
//loading params
RunParam runParams = null;
try
{
UrlProcessorsManager processor = null;
//get loading params
runParams = ParamsHelper.GetParams(args);
//create processor object and read data from file
processor = new UrlProcessorsManager(runParams.InputFileName);
//process data with number of threads
processor.Process(runParams.ThreadsNumber);
//save result to the file
processor.WriteResultFile(runParams.OutputFileName);
Logger.Log(String.Format("{0}>> Processing done", DateTime.Now.ToString("u")));
Console.WriteLine("done.... See {0} for results", runParams.OutputFileName);
Console.WriteLine("See log in {0}", ((Log.FileLogger)Logger).FileName);
Console.WriteLine("Press ENTER");
Console.ReadLine();
}
catch (Exception e)
{
Logger.Log(e.Message);
Console.WriteLine("Runtime Error: {0}",e.Message);
Console.WriteLine("Press ENTER");
Console.ReadLine();
}
Logger.Log(String.Format("{0}>> Application Stop", DateTime.Now.ToString("u")));
Logger.Dispose();
}
}
}