프로젝트

일반

사용자정보

개정판 664ea2e1

ID664ea2e1cd505cbe9d76095ca8e3f8de5f2e9bd2
상위 9d5b4bc2
하위 5e1e22ff

김태성이(가) 4년 이상 전에 추가함

Markus에서 markusupdate를 변경하도록 수정

Change-Id: I4c2fe33f46732a9dc6b1fe683771c5acbcfd5d36

차이점 보기:

DownloadManager/Program.cs
1 1

2
using log4net;
2 3
using System;
3 4
using System.Collections.Generic;
4 5
using System.Diagnostics;
......
11 12
{
12 13
    class Program
13 14
    {
15
        private static ILog logger = LogManager.GetLogger(typeof(Program));
16

  
14 17
        private static string TEMP_FOLDER = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "MARKUS");
15 18

  
16 19
        static IIpc.WcfClient wcfClient;
......
39 42
        {
40 43
            try
41 44
            {
45
                logger.Info($"param : {string.Join(",", args)}");
42 46

  
43 47
                if (args.Length > 0)
44 48
                {
......
55 59
                    //}
56 60
                    if (args[0] == IIpc.ProcessTypeDefine.DEFINE_MONITOR)
57 61
                    {
62
                        CheckAutoUpdate.Validation();
63

  
58 64
                        IsDebug = bool.Parse(args[1]);
59 65
                        int processId = int.Parse(args[2]); /// kcom process id
60 66
                        int thumbnamilPID = int.Parse(args[3]);
......
134 140
                                    webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
135 141
                                }
136 142

  
137
                                client.DownloadFileAsync(new Uri(args[3]), args[4]);
143
                                client.DownloadFileAsync(new Uri(System.Web.HttpUtility.UrlDecode(args[3])), args[4]);
138 144
                            }
139 145
                        }
140 146

  
......
153 159
            }
154 160
            catch (Exception ex)
155 161
            {
156

  
162
                logger.Error($"param : {string.Join(",", args)}", ex);
157 163
                System.Diagnostics.Debug.WriteLine(ex);
158 164
            }
159 165
        }
160 166

  
161 167
        public static void DeleteFiles(string processType, string path)
162 168
        {
163
            if(processType == IIpc.ProcessTypeDefine.DEFINE_THUMBNAIL)
169
            try
164 170
            {
165
                var dir = System.IO.Directory.GetDirectories(path, "*.*", System.IO.SearchOption.AllDirectories);
171
                if (processType == IIpc.ProcessTypeDefine.DEFINE_THUMBNAIL)
172
                {
173
                    var dir = System.IO.Directory.GetDirectories(path, "*.*", System.IO.SearchOption.AllDirectories);
166 174

  
167
                for (int i = 0; i < dir.Length; i++)
175
                    for (int i = 0; i < dir.Length; i++)
176
                    {
177
                        System.IO.Directory.Delete(dir[i], true);
178
                    }
179
                }
180
                else
168 181
                {
169
                    System.IO.Directory.Delete(dir[i],true);
182
                    if (System.IO.File.Exists(path))
183
                    {
184
                        System.IO.File.Delete(path);
185
                    }
170 186
                }
171 187
            }
172
            else
188
            catch (Exception ex)
173 189
            {
174
                if (System.IO.File.Exists(path))
175
                {
176
                    System.IO.File.Delete(path);
177
                }
190
                logger.Error($"DeleteFiles Error {processType} {path}", ex);
191
                System.Diagnostics.Debug.WriteLine(ex);
178 192
            }
193
        
179 194
        }
180 195

  
181 196
        private static Process FindProcess(int id)
......
191 206
                    result = process.First();
192 207
                }
193 208
            }
194
            catch (Exception)
209
            catch (Exception ex)
195 210
            {
211
                logger.Error($"FindProcess Error {id}", ex);
212
                System.Diagnostics.Debug.WriteLine(ex);
196 213
            }
197 214

  
198 215
            return result;
......
201 218

  
202 219
        private static void ConsoleWrite(string data)
203 220
        {
221
            logger.Info(data);
222

  
204 223
            if (IsDebug)
205 224
            {
206 225
                Console.WriteLine(data);

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)