Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FileInfo fi = new FileInfo(fullpath);
- String b64ZippedData = String.Empty;
- using (FileStream filestream = fi.OpenRead()) // source
- {
- using (MemoryStream memorystream = new MemoryStream()) // destination
- {
- using (GZipStream gzipstream = new GZipStream(memorystream, CompressionMode.Compress, false)) // compression engine
- {
- filestream.CopyTo(gzipstream);
- }
- b64ZippedData = System.Convert.ToBase64String(memorystream.ToArray());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement