當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。