markus / ConvertService / ServiceBase / Markus.Service.ConvertProcess / Program.cs @ bfffd66f
이력 | 보기 | 이력해설 | 다운로드 (1.72 KB)
1 |
using log4net; |
---|---|
2 |
using Markus.Message; |
3 |
using Markus.Service.Extensions; |
4 |
using Markus.Service.Helper; |
5 |
using System; |
6 |
using System.Collections.Generic; |
7 |
using System.Linq; |
8 |
using System.ServiceModel; |
9 |
using System.Text; |
10 |
using System.Threading.Tasks; |
11 |
using System.Web.Script.Serialization; |
12 |
using System.Windows.Forms; |
13 |
using static Markus.Service.Extensions.Encrypt; |
14 |
|
15 |
namespace Markus.Service.ConvertProcess |
16 |
{ |
17 |
class Convert |
18 |
{ |
19 |
protected static ILog logger; |
20 |
protected static Service.Convert.ConvertService convert; |
21 |
|
22 |
private static ProcessContext convetContext; |
23 |
|
24 |
[MTAThread] |
25 |
static void Main(string[] args) |
26 |
{ |
27 |
try |
28 |
{ |
29 |
logger = LogManager.GetLogger(typeof(Convert)); |
30 |
|
31 |
if (args.Length == 2) |
32 |
{ |
33 |
string ConvertID = args[0]; |
34 |
|
35 |
convetContext = ObjectToBytesStringConvert.BytesStringToObject<ProcessContext>(AESEncrypter.Decrypt(args[1])); |
36 |
|
37 |
convert = new Service.Convert.ConvertService(convetContext); |
38 |
|
39 |
var convertFile = convert.SetFileAsync(); |
40 |
convertFile.Wait(); |
41 |
|
42 |
if(convertFile.Result.StatusCode != StatusCodeType.Completed) |
43 |
{ |
44 |
logger.Error($"Markus.Service.ConvertProcess Error ConvertId : {convetContext.ConvertID}"); |
45 |
} |
46 |
} |
47 |
} |
48 |
catch (Exception ex) |
49 |
{ |
50 |
logger.Error($"Markus.Service.ConvertProcess Error ConvertId : {convetContext.ConvertID}", ex); |
51 |
} |
52 |
finally |
53 |
{ |
54 |
convert?.Dispose(); |
55 |
Application.Exit(); |
56 |
} |
57 |
} |
58 |
} |
59 |
} |