shell32 dll add reference to shell32.dll code example
Example 1: shell32.dll c# example
public void CreateZipFile(string filename)
{
System.Text.ASCIIEncoding Encoder = new System.Text.ASCIIEncoding();
string sHeader = "PK" + (char)5 + (char)6;
sHeader = sHeader.PadRight(22, (char)0);
byte[] baHeader = System.Text.Encoding.ASCII.GetBytes(sHeader);
FileStream fs = File.Create(filename);
fs.Write(baHeader, 0, baHeader.Length);
fs.Flush();
fs.Close();
fs = null;
}
Example 2: shell32.dll c# example
public void ZipFile(string Input, string Filename)
{
Shell32.Shell Shell = new Shell32.Shell();
CreateZipFile(Filename);
Shell.NameSpace(Filename).CopyHere(Input,0);
System.Threading.Thread.Sleep(2000);
}
}