Compare Page Revisions
« Older Revision - Back to Page History - Current Revision
application/vnd.xfdl;content-encoding="base64-gzip" H4sIAAAAAAAAC+y9aZOiyrYw/N1fwdMn4vbeYXfJqLBP776BgooDoOL4xhMdCKgoAjI4xfPj3wS0 RkWtkqoePHHv7hKSHFauOVeu9e1/13MDWmqOq1vmv5+QO/gTpJmKperm+N9PXEv4SpIE9RX59L/f ...
using System; using System.IO; using System.IO.Compression; . . . /*--- Inits ---*/ const string INPUT_FILE = @"MyFile.xfdl"; string outputFile = Path.ChangeExtension(INPUT_FILE, ".xml"); /*--- Load file contents ---*/ var fileContent = File.ReadAllText(INPUT_FILE); /*--- Strip out first line ---*/ var pos = fileContent.IndexOf('\n') + 1; var s = fileContent.Substring(pos); /*--- Decode Base64 to Binary ---*/ var bytes = Convert.FromBase64String(s); var inputStream = new MemoryStream(bytes); /*--- Ungzip ---*/ using (FileStream outputStream = File.Create(outputFile)) { using (GZipStream gZip = new GZipStream(inputStream, CompressionMode.Decompress)) { gZip.CopyTo(outputStream); } }
ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.