当前位置: 首页>>代码示例>>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;未经允许,请勿转载。