프로젝트

일반

사용자정보

통계
| 브랜치(Branch): | 개정판:

markus / MarkusAutoUpdate / src / NetSparkle.Samples.NetFramework.WPF / App.xaml.cs @ 274cde11

이력 | 보기 | 이력해설 | 다운로드 (1.6 KB)

1 d8f5045e taeseongkim
using log4net;
2
using Salaros.Configuration;
3
using System;
4
using System.Collections.Generic;
5
using System.Configuration;
6
using System.Data;
7
using System.Globalization;
8
using System.Linq;
9
using System.Windows;
10
11
namespace NetSparkleUpdater.Samples.NetFramework.WPF
12
{
13
    /// <summary>
14
    /// Interaction logic for App.xaml
15
    /// </summary>
16
    public partial class App : Application
17
    {
18
        public static string KcomParam = null;
19
        public static string AppCastUri = null;
20
21
        public static ILog logger = LogManager.GetLogger(typeof(App));
22
23
        public App()
24
        {
25
26
        }
27
28
        protected override void OnStartup(StartupEventArgs e)
29
        {
30
            try
31
            {
32
                KcomParam = e.Args[0];
33
34
                var startDir = AppDomain.CurrentDomain.BaseDirectory;
35
                var configFilePath = $"{System.IO.Path.Combine(startDir, "Markus.AppUpdate.ini")}";
36
37
                var config = new ConfigParser(configFilePath,
38
                                new ConfigParserSettings
39
                                {
40
                                    MultiLineValues = MultiLineValues.Simple | MultiLineValues.AllowValuelessKeys | MultiLineValues.QuoteDelimitedValues,
41
                                    Culture = new CultureInfo("en-US")
42
                                });
43
44
                AppCastUri = config.GetValue("APP_CAST", "URI");
45
46
                App.logger.Info($"App Cast Uri : {AppCastUri}");
47
48
                base.OnStartup(e);
49
            }
50
            catch (Exception ex) 
51
            {
52
                logger.Error("Startup Error ", ex);
53
            }
54
        }
55
    }
56
}
클립보드 이미지 추가 (최대 크기: 500 MB)