當前位置: 首頁>>代碼示例>>C#>>正文


C# POIFSFileSystem.Dispose方法代碼示例

本文整理匯總了C#中NPOI.POIFS.FileSystem.POIFSFileSystem.Dispose方法的典型用法代碼示例。如果您正苦於以下問題:C# POIFSFileSystem.Dispose方法的具體用法?C# POIFSFileSystem.Dispose怎麽用?C# POIFSFileSystem.Dispose使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在NPOI.POIFS.FileSystem.POIFSFileSystem的用法示例。


在下文中一共展示了POIFSFileSystem.Dispose方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Write

        /// <summary>
        /// Write out this workbook to an Outputstream.  Constructs
        /// a new POI POIFSFileSystem, passes in the workbook binary representation  and
        /// Writes it out.
        /// </summary>
        /// <param name="stream">the java OutputStream you wish to Write the XLS to</param>
        public override void Write(Stream stream)
        {
            byte[] bytes = GetBytes();
            POIFSFileSystem fs = new POIFSFileSystem();
            // For tracking what we've written out, used if we're
            //  going to be preserving nodes
            List<string> excepts = new List<string>(1);

            MemoryStream newMemoryStream = new MemoryStream(bytes);
            // Write out the Workbook stream
            fs.CreateDocument(newMemoryStream, "Workbook");

            // Write out our HPFS properties, if we have them
            WriteProperties(fs, excepts);

            if (preserveNodes)
            {
                // Don't Write out the old Workbook, we'll be doing our new one
                excepts.Add("Workbook");
                // If the file had WORKBOOK instead of Workbook, we'll Write it
                //  out correctly shortly, so don't include the old one
                excepts.Add("WORKBOOK");

                // Copy over all the other nodes to our new poifs
                CopyNodes(this.filesystem, fs, excepts);
            }
            fs.WriteFileSystem(stream);

            fs.Dispose();
            newMemoryStream.Dispose();
            bytes = null;
        }
開發者ID:babywzazy,項目名稱:Server,代碼行數:38,代碼來源:HSSFWorkbook.cs


注:本文中的NPOI.POIFS.FileSystem.POIFSFileSystem.Dispose方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。