コード例 #1
0
ファイル: Program.cs プロジェクト: Bowerbird/bowerbird-web
        public void FetchTheData()
        {
            Logger _logger = LogManager.GetLogger("Bowerbird.Import");

            _configSettings = ConfigSettings.Singleton();

            _pathToWebResource = string.Format(
                "{0}/{1}",
                _configSettings.GetUriToSite(),
                _configSettings.GetFileName()
                );

            _pathToLocalResource = string.Format(
                "{0}\\{1}",
                _configSettings.GetEnvironmentRootPath(),
                _configSettings.GetFileName()
                );

            if (File.Exists(_pathToLocalResource))
            {
                File.Delete(_pathToLocalResource);
            }

            using (_wc = new WebClient())
            {
                _wc.DownloadFile(_pathToWebResource, _pathToLocalResource);
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: Bowerbird/bowerbird-web
 public static ConfigSettings Singleton()
 {
     return _singleton ?? (_singleton = new ConfigSettings());
 }