public void Extract(Int32 iChunk, string sZipFileName, string sNewFileName) { string sCompare = sZipFileName.ParseString(":", 1).ToUpper(); string sCypherChunk = ivFile["x" + iChunk.ToString()]; string sChunk = kpFileKey.NextKeyPair(iChunk).toDecryptAES(sCypherChunk); MemoryStream zipMS = new MemoryStream(sChunk.toByteArray()); using (ZipFile z = ZipFile.Read(zipMS)) { foreach (ZipEntry ze in z) { string sFileName = ze.FileName.ToUpper(); if (sFileName == sCompare) { string sWorkingPath = MMExt.UserLogLocation(); string sAddPathAndFile = ze.FileName.Replace('/', '\\'); ze.Extract(sWorkingPath, ExtractExistingFileAction.OverwriteSilently); if (File.Exists(sWorkingPath + sAddPathAndFile)) { File.Copy(sWorkingPath + sAddPathAndFile, sNewFileName); } if (File.Exists(sWorkingPath + sAddPathAndFile)) { File.Delete(sWorkingPath + sAddPathAndFile); } } } } }
private void button1_Click(object sender, EventArgs e) { string sFilePathName = EnsureDestFileUnique(MMExt.UserLogLocation() + "Excel01.xlsx"); MMExcel.MMExcel mm = new MMExcel.MMExcel(StartMode.smNew, sFilePathName); MMWS ws0 = mm.Sheet[0]; ws0.Name = "ZeroSheet"; double dInchValue = 0.25; ws0["A1", "AB120"].RowHeight = dInchValue.toPointsVertical(); ws0["A1", "AB120"].ColumnWidth = dInchValue.toPointsHorizontal(); // dColWidthPerPoint * dInchValue.toPointsHorizontal(); ws0["A1", "A1"].Rng.Font.Name = "Century Gothic"; Excel.Font fontA = ws0["A1", "A1"].Rng.Font; mm.Close(); Process.Start(sFilePathName); }