예제 #1
0
        private void btnListZipFiles_Click(object sender, System.EventArgs e)
        {
            openFileDialog1.ShowDialog();
            string file = openFileDialog1.FileName;

            if (file == null | file == string.Empty)
            {
                return;
            }

            //Clear the DLL messages output area
            prgBar.Value     = prgBar.Minimum;
            lblProgress.Text = "";
            textBox1.Text    = "";

            //Instantiate the Unzip object
            m_Unzip = new Unzip();

            //NOTE:
            //There are many unzip options.  This sample just demonstrates basic unzip options.
            //Consult the InfoZip documentation for more option information.

            //Set the Unzip object properties
            m_Unzip.ZipFileName      = file;
            m_Unzip.HonorDirectories = HonorDirectoriesEnum.True;
            m_Unzip.ExtractOrList    = ExtractOrListEnum.ListContents;

            //Wire the event handlers to receive the events from the Unzip class
            m_Unzip.ReceivePrintMessage   += new UnZipDLLPrintMessageEventHandler(unZip_ReceivePrintMessage);
            m_Unzip.ReceiveServiceMessage += new UnZipDLLServiceMessageEventHandler(unZip_ReceiveServiceMessage);

            //Unzip the files
            ZipFileEntries zfes = m_Unzip.GetZipFileContents();

            //Show the file contents
            frmShowContents frm = new frmShowContents();

            frm.UnzippedFileCollection = zfes;

            //WORK AROUND:
            frm.Comment = m_Unzip.GetZipFileComment();

            frm.ShowDialog(this);

            //Examine the return code
            MessageBox.Show("Done.");
        }
예제 #2
0
		private void btnListZipFiles_Click(object sender, System.EventArgs e)
		{

			openFileDialog1.ShowDialog();
			string file = openFileDialog1.FileName;

			if (file == null | file == string.Empty) return;

			//Clear the DLL messages output area
			prgBar.Value = prgBar.Minimum;
			lblProgress.Text = "";
			textBox1.Text = "";

			//Instantiate the Unzip object
			m_Unzip = new Unzip();

			//NOTE:
			//There are many unzip options.  This sample just demonstrates basic unzip options.
			//Consult the InfoZip documentation for more option information.

			//Set the Unzip object properties
			m_Unzip.ZipFileName = file;
			m_Unzip.HonorDirectories = HonorDirectoriesEnum.True;
			m_Unzip.ExtractOrList = ExtractOrListEnum.ListContents;

			//Wire the event handlers to receive the events from the Unzip class
			m_Unzip.ReceivePrintMessage +=new UnZipDLLPrintMessageEventHandler(unZip_ReceivePrintMessage);
			m_Unzip.ReceiveServiceMessage +=new UnZipDLLServiceMessageEventHandler(unZip_ReceiveServiceMessage);

			//Unzip the files
			ZipFileEntries zfes = m_Unzip.GetZipFileContents();

			//Show the file contents
			frmShowContents frm = new frmShowContents();
			frm.UnzippedFileCollection = zfes;

			//WORK AROUND:
			frm.Comment = m_Unzip.GetZipFileComment();

			frm.ShowDialog(this);

			//Examine the return code
			MessageBox.Show("Done.");

		}