Exemple #1
0
        // Download new version of each file in the collection
        // Collection of files, each one is <Remote Path>|<Local Path>
        public static void UpdateFile(string localFile, string remotePath)
        {
            #if !DEBUG
            try
            {
            #endif
                int bytes = DownloadFile(remotePath, localFile);

                // Don't adjust file if nothing was downloaded...
                if ((bytes > 0) && (Path.GetExtension(localFile) == ".rss"))
                {
                    RssConverter converter = new RssConverter();
                    string convertedFile = Path.ChangeExtension(localFile, "html");
                    converter.RssToHtml(localFile, convertedFile);
                }
            #if !DEBUG
            }
            // Catch ALL exceptions silently. Updating the news should NOT crash the application EVER
            catch(Exception){};
            #endif
        }
Exemple #2
0
        // Download new version of each file in the collection
        // Collection of files, each one is <Remote Path>|<Local Path>
        public static void UpdateFile(string localFile, string remotePath)
        {
            #if !DEBUG
            try
            {
            #endif
            int bytes = DownloadFile(remotePath, localFile);

            // Don't adjust file if nothing was downloaded...
            if ((bytes > 0) && (Path.GetExtension(localFile) == ".rss"))
            {
                RssConverter converter     = new RssConverter();
                string       convertedFile = Path.ChangeExtension(localFile, "html");
                converter.RssToHtml(localFile, convertedFile);
            }
            #if !DEBUG
        }

        // Catch ALL exceptions silently. Updating the news should NOT crash the application EVER
        catch (Exception) {};
            #endif
        }