Hey there, i am trying to zip .bak files while making the backup , this application schedules backups and then backs up databases on the server , so now i want to zip or compres these files , can anyone give me some advise on how to do this ??
private void openfiledialog_Click(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
textBox1.Text = openFileDialog1.FileName;
openFileDialog1.Dispose();
}
private void LetsZIPIT(object sender, EventArgs e)
{
try
{
FileStream m_FileStream = File.Open(textBox1.Text, FileMode.OpenOrCreate);
GZipStream ZipStream = new GZipStream(m_FileStream, CompressionMode.Compress, true);
//ZipStream.Write(byte[], 0, 1);
MessageBox.Show("SUCCESSSSSSSS.........");
}
catch (Exception E)
{
MessageBox.Show(E.Message);
}
}
private void btnzip_Click(object sender, EventArgs e)
{
LetsZIPPPIT(sender, e);
}
This just takes all the data out of the file .... i feel stupid for no knowing this ...
Any example will be amazing , even if its just to zip a text file , i will play with the code,
Regards,
mr Von Zipper