This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class CompressionExtensions | |
{ | |
public static void Compress(FileInfo fileToCompress) | |
{ | |
using (FileStream originalFileStream = fileToCompress.OpenRead()) | |
{ | |
if ((File.GetAttributes(fileToCompress.FullName) & FileAttributes.Hidden) != FileAttributes.Hidden & fileToCompress.Extension != ".gz") | |
{ | |
using (FileStream compressedFileStream = File.Create(fileToCompress.FullName + ".gz")) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Uri uri = new Uri(hreflink); | |
if (uri.IsFile) { | |
string filename = System.IO.Path.GetFileName(uri.LocalPath); | |
} |