Note that there are some explanatory texts on larger screens.

plurals
  1. POC# compress with .tar
    primarykey
    data
    text
    <p>I am trying to do programming to compress with <code>.tar</code> and the source code I do programming is the example provided at Microsoft homepage. but there is an error. I don't know why, everything is same as an example at Microsoft homepage. </p> <p>error is </p> <blockquote> <p>System.NotSupportedException: The given path's format is not supported.</p> </blockquote> <pre><code>namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { //this directory is what I wanna compress.. string directoryPath = @"C:\\sfdsf"; DirectoryInfo directorySelected = new DirectoryInfo(directoryPath); foreach (FileInfo filetoCompress in directorySelected.GetFiles()) { Compress(filetoCompress); } } public static void Compress(FileInfo fileToCompress) { using (FileStream originalFileStream = fileToCompress.OpenRead()) { if ((File.GetAttributes(fileToCompress.FullName) &amp; FileAttributes.Hidden) != FileAttributes.Hidden &amp; fileToCompress.Extension != ".tar") { using (FileStream compressedFileStream = File.Create(DateTime.Now+ ".tar")) { using (DeflateStream compressionStream = new DeflateStream(compressedFileStream, CompressionMode.Compress)) { originalFileStream.CopyTo(compressionStream); MessageBox.Show("Compressed" + fileToCompress.Name + "from" + fileToCompress.Length.ToString() + " to" + compressedFileStream.Length.ToString () +" bytes."); } } } } } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload