コード例 #1
0
ファイル: UsenetPoster.cs プロジェクト: jonnyboy/nntpPoster
        private void MakeRarAndParFiles(FileSystemInfo toPost, String nameWithoutExtension,
            DirectoryInfo processedFolder, String password)
        {
            Int64 size = toPost.Size();
            var rarSizeRecommendation = configuration.RarNParSettings
                .Where(rr => rr.FromSize < size)
                .OrderByDescending(rr => rr.FromSize)
                .First();
            var rarWrapper = new RarWrapper(configuration.InactiveProcessTimeout, configuration.RarLocation);
            rarWrapper.Compress(
                toPost,
                processedFolder,
                nameWithoutExtension,
                Settings.DetermineOptimalRarSize(rarSizeRecommendation.RarSize,
                    configuration.YEncLineSize, configuration.YEncLinesPerMessage),
                password);

            var parWrapper = new ParWrapper(configuration.InactiveProcessTimeout, configuration.ParLocation);
            parWrapper.CreateParFilesInDirectory(
                processedFolder, nameWithoutExtension, configuration.YEncPartSize, rarSizeRecommendation.Par2Percentage);
        }
コード例 #2
0
ファイル: UsenetPoster.cs プロジェクト: youvee/nntpPoster
        private void MakeRarAndParFiles(FileSystemInfo toPost, String nameWithoutExtension,
            DirectoryInfo processedFolder)
        {
            Int64 size = toPost.Size();
            var rarSizeRecommendation = configuration.RecommendationMap
                .Where(rr => rr.FromFileSize < size)
                .OrderByDescending(rr => rr.FromFileSize)
                .First();
            var rarWrapper = new RarWrapper(configuration.InactiveProcessTimeout, configuration.RarLocation);
            rarWrapper.Compress(
                toPost, processedFolder, nameWithoutExtension, rarSizeRecommendation.ReccomendedRarSize);

            var parWrapper = new ParWrapper(configuration.InactiveProcessTimeout, configuration.ParLocation);
            parWrapper.CreateParFilesInDirectory(
                processedFolder, nameWithoutExtension, configuration.YEncPartSize, rarSizeRecommendation.ReccomendedRecoveryPercentage);
        }