Links:
http://www.iis.net/community/default.aspx?tabid=34&i=1466&g=6
http://www.iis.net/community/default.aspx?tabid=34&i=1466&g=6
From: Connections Conferences [mailto:ConnectionsConferences@pentontech.com]
Sent: Thursday, July 15, 2010 9:50 PM
To: Suresh Babu Anumolu
Subject: ASP.net, Silverlight, Visual Studio, Sharepoint and beyond -- Register now for Fall DevConnections
Don't miss THE most comprehensive conference for developers featuring in-depth tracks on Visual Studio and ASP.net, Silverlight and much more. Reserve your spot now for DevConnections 2010, November 1-4 in Las Vegas, NV -- registration open now! Early Bird Registration -- Book your room by July 29 and receive a discounted rate of only $149 night plus tax. Need more incentive? Register for Connections and book 3 nights at Mandalay Bay by July 29th and receive a great rate AND a $100 Mandalay Bay gift certificate. For more info, visit us online or call (203) 400-6121 or 800-438-6720. Read on for more information about the Visual Studio Connections and Microsoft® ASP.net and Silverlight Connections conference. DevConnections events are co-located, each with their own set of tracks and speakers. As an attendee of one show you may attend the sessions at any of the concurrent events for FREE.
Don't miss out on THE 2010 event for developer training! For the latest news, updates, and special offers, follow DevConnections on Twitter! | ||
You are subscribed as babu@riskspan.com
You received this email because you have an existing business relationship with Connections Conferences, a division of Penton Media, Inc. Periodically, we will inform you of special Penton-related shows, products and other offers that we believe you will find helpful in your business or career. To STOP receiving promotional e-mails from Connections Conferences, please click here to opt-out.
Contact us with feedback or questions.
Connections Conferences | Penton Media, Inc. | 249 W. 17th Street | New York, NY 10011 | Privacy Statement
using System;
using System.IO;
using System.IO.Compression;
public class Program
{
public static void Main()
{
// Path to directory of files to compress and decompress.
string dirpath = @"c:\users\public\reports";
DirectoryInfo di = new DirectoryInfo(dirpath);
// Compress the directory's files.
foreach (FileInfo fi in di.GetFiles())
{
Compress(fi);
}
// Decompress all *.cmp files in the directory.
foreach (FileInfo fi in di.GetFiles("*.cmp"))
{
Decompress(fi);
}
}
public static void Compress(FileInfo fi)
{
// Get the stream of the source file.
using (FileStream inFile = fi.OpenRead())
{
// Prevent compressing hidden and already compressed files.
if ((File.GetAttributes(fi.FullName) & FileAttributes.Hidden)
!= FileAttributes.Hidden & fi.Extension != ".cmp")
{
// Create the compressed file.
using (FileStream outFile =
File.Create(fi.FullName + ".cmp"))
{
using (DeflateStream Compress =
new DeflateStream(outFile,
CompressionMode.Compress))
{
// Copy the source file into
// the compression stream.
inFile.CopyTo(Compress);
Console.WriteLine("Compressed {0} from {1} to {2} bytes.",
fi.Name, fi.Length.ToString(), outFile.Length.ToString());
}
}
}
}
}
public static void Decompress(FileInfo fi)
{
// Get the stream of the source file.
using (FileStream inFile = fi.OpenRead())
{
// Get original file extension,
// for example "doc" from report.doc.cmp.
string curFile = fi.FullName;
string origName = curFile.Remove(curFile.Length
- fi.Extension.Length);
//Create the decompressed file.
using (FileStream outFile = File.Create(origName))
{
using (DeflateStream Decompress = new DeflateStream(inFile,
CompressionMode.Decompress))
{
// Copy the decompression stream
// into the output file.
Decompress.CopyTo(outFile);
Console.WriteLine("Decompressed: {0}", fi.Name);
}
}
}
}
}