当前位置: 首页>>代码示例>>C#>>正文


C# DirectoryNode.CreateDocumentInputStream方法代码示例

本文整理汇总了C#中NPOI.POIFS.FileSystem.DirectoryNode.CreateDocumentInputStream方法的典型用法代码示例。如果您正苦于以下问题:C# DirectoryNode.CreateDocumentInputStream方法的具体用法?C# DirectoryNode.CreateDocumentInputStream怎么用?C# DirectoryNode.CreateDocumentInputStream使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NPOI.POIFS.FileSystem.DirectoryNode的用法示例。


在下文中一共展示了DirectoryNode.CreateDocumentInputStream方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EncryptionInfo

        public EncryptionInfo(DirectoryNode dir)
        {
            DocumentInputStream dis = dir.CreateDocumentInputStream("EncryptionInfo");
            versionMajor = dis.ReadShort();
            versionMinor = dis.ReadShort();

            encryptionFlags = dis.ReadInt();

            if (versionMajor == 4 && versionMinor == 4 && encryptionFlags == 0x40)
            {
                StringBuilder builder = new StringBuilder();
                byte[] xmlDescriptor = new byte[dis.Available()];
                dis.Read(xmlDescriptor);
                foreach (byte b in xmlDescriptor)
                    builder.Append((char)b);
                string descriptor = builder.ToString();
                header = new EncryptionHeader(descriptor);
                verifier = new EncryptionVerifier(descriptor);
            }
            else
            {
                int hSize = dis.ReadInt();
                header = new EncryptionHeader(dis);
                if (header.Algorithm == EncryptionHeader.ALGORITHM_RC4)
                {
                    verifier = new EncryptionVerifier(dis, 20);
                }
                else
                {
                    verifier = new EncryptionVerifier(dis, 32);
                }
            }
        }
开发者ID:JnS-Software-LLC,项目名称:npoi,代码行数:33,代码来源:EncryptionInfo.cs

示例2: CreateFromEmbeddedOleObject

        /// <summary>
        /// Creates an instance of this class from an embedded OLE Object. The OLE Object is expected
        /// to include a stream &quot;{01}Ole10Native&quot; which contains the actual
        /// data relevant for this class.
        /// </summary>
        /// <param name="directory">directory POI Filesystem object</param>
        /// <returns>Returns an instance of this class</returns>
        public static Ole10Native CreateFromEmbeddedOleObject(DirectoryNode directory)
        {
            bool plain = false;

            try
            {
                directory.GetEntry("\u0001Ole10ItemName");
                plain = true;
            }
            catch (FileNotFoundException)
            {
                plain = false;
            }

            DocumentEntry nativeEntry =
               (DocumentEntry)directory.GetEntry(OLE10_NATIVE);
            byte[] data = new byte[nativeEntry.Size];
            directory.CreateDocumentInputStream(nativeEntry).Read(data);

            return new Ole10Native(data, 0, plain);
        }
开发者ID:89sos98,项目名称:npoi,代码行数:28,代码来源:Ole10Native.cs

示例3: GetDataStream

 public override Stream GetDataStream(DirectoryNode dir)
 {
     DocumentInputStream dis = dir.CreateDocumentInputStream("EncryptedPackage");
     _length = dis.ReadLong();
     return new ChunkedCipherInputStream(dis, _length, this);
 }
开发者ID:xiepeixing,项目名称:npoi,代码行数:6,代码来源:AgileDecryptor.cs

示例4: Open

        private void Open(DirectoryNode directory)
        {
            DocumentNode book = (DocumentNode)directory.GetEntry("Book");
            if (book == null)
            {
                throw new IOException("No Excel 5/95 Book stream found");
            }

            ris = new RecordInputStream(directory.CreateDocumentInputStream(book));
            Prepare();
        }
开发者ID:age-soft,项目名称:npoi,代码行数:11,代码来源:OldExcelExtractor.cs

示例5: GetPropertySet

 PropertySet GetPropertySet(DirectoryNode dir, string name)
 {
     DocumentInputStream dis = dir.CreateDocumentInputStream(name);
     PropertySet set = PropertySetFactory.Create(dis);
     return set;
 }
开发者ID:iraychen,项目名称:toxy,代码行数:6,代码来源:OLE2MetadataParser.cs

示例6: GetDataStream

 public override Stream GetDataStream(DirectoryNode dir)
 {
     DocumentInputStream dr = dir.CreateDocumentInputStream("EncryptedPackage");
     long size = dr.ReadLong();
     SymmetricAlgorithm cipher=GetCipher();
     return new CryptoStream(dr, cipher.CreateDecryptor(cipher.Key, cipher.IV), CryptoStreamMode.Read);
 }
开发者ID:xoposhiy,项目名称:npoi,代码行数:7,代码来源:EcmaDecryptor.cs

示例7: CreateFromEmbeddedOleObject

        /// <summary>
        /// Creates an instance of this class from an embedded OLE Object. The OLE Object is expected
        /// to include a stream &quot;{01}Ole10Native&quot; which contains the actual
        /// data relevant for this class.
        /// </summary>
        /// <param name="directory">directory POI Filesystem object</param>
        /// <returns>Returns an instance of this class</returns>
        public static Ole10Native CreateFromEmbeddedOleObject(DirectoryNode directory)
        {
            DocumentEntry nativeEntry =
               (DocumentEntry)directory.GetEntry(OLE10_NATIVE);
            byte[] data = new byte[nativeEntry.Size];
            directory.CreateDocumentInputStream(nativeEntry).Read(data);

            return new Ole10Native(data, 0);
        }
开发者ID:Reinakumiko,项目名称:npoi,代码行数:16,代码来源:Ole10Native.cs

示例8: GetDataStream

 public override Stream GetDataStream(DirectoryNode dir)
 {
     DocumentInputStream dr = dir.CreateDocumentInputStream("EncryptedPackage");
     long size = dr.ReadLong();
     return new ChunkedCipherInputStream(dr, size, this);
 }
开发者ID:xoposhiy,项目名称:npoi,代码行数:6,代码来源:AgileDecryptor.cs


注:本文中的NPOI.POIFS.FileSystem.DirectoryNode.CreateDocumentInputStream方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。