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


C# DirectoryEntry.CreateDirectory方法代码示例

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


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

示例1: CopyNodeRecursively

        /**
         * Copies an Entry into a target POIFS directory, recursively
         */

        public static void CopyNodeRecursively(Entry entry, DirectoryEntry target)
        {
            // System.err.println("copyNodeRecursively called with "+entry.GetName()+
            // ","+tarGet.getName());
            DirectoryEntry newTarget = null;
            if (entry.IsDirectoryEntry)
            {
                newTarget = target.CreateDirectory(entry.Name);
                IEnumerator entries = ((DirectoryEntry)entry).Entries;

                while (entries.MoveNext())
                {
                    CopyNodeRecursively((Entry)entries.Current, newTarget);
                }
            }
            else
            {
                DocumentEntry dentry = (DocumentEntry)entry;
                using (DocumentInputStream dstream = new DocumentInputStream(dentry))
                {
                    target.CreateDocument(dentry.Name, dstream);
                    //now part of usings call to Dispose: dstream.Close();
                }
            }
        }
开发者ID:Johnnyfly,项目名称:source20131023,代码行数:29,代码来源:POIUtils.cs

示例2: CopyNodeRecursively

        /**
     * Copies an Entry into a target POIFS directory, recursively
     */
        public static void CopyNodeRecursively(Entry entry, DirectoryEntry target)
        {
            // System.err.println("copyNodeRecursively called with "+entry.getName()+
            // ","+target.getName());
            DirectoryEntry newTarget = null;
            if (entry.IsDirectoryEntry)
            {
                DirectoryEntry dirEntry = (DirectoryEntry)entry;
                newTarget = target.CreateDirectory(entry.Name);
                newTarget.StorageClsid=(dirEntry.StorageClsid);
                IEnumerator<Entry> entries = dirEntry.Entries;

                while (entries.MoveNext())
                {
                    CopyNodeRecursively((Entry)entries.Current, newTarget);
                }
            }
            else
            {
                DocumentEntry dentry = (DocumentEntry)entry;
                DocumentInputStream dstream = new DocumentInputStream(dentry);
                target.CreateDocument(dentry.Name, dstream);
                dstream.Close();
            }
        }
开发者ID:Reinakumiko,项目名称:npoi,代码行数:28,代码来源:EntryUtils.cs

示例3: setUp

 protected void setUp()
 {
     fs = new POIFSFileSystem();
     dirA = fs.CreateDirectory("DirA");
     dirB = fs.CreateDirectory("DirB");
     dirAA = dirA.CreateDirectory("DirAA");
     eRoot = fs.Root.CreateDocument("Root", new ByteArrayInputStream(new byte[] { }));
     eA = dirA.CreateDocument("NA", new ByteArrayInputStream(new byte[] { }));
     eAA = dirAA.CreateDocument("NAA", new ByteArrayInputStream(new byte[] { }));
 }
开发者ID:hanwangkun,项目名称:npoi,代码行数:10,代码来源:TestFilteringDirectoryNode.cs

示例4: CopyNodeRecursively

        /// <summary>
        /// Copies an Entry into a target POIFS directory, recursively
        /// </summary>
        /// <param name="entry">The entry.</param>
        /// <param name="target">The target.</param>
        private void CopyNodeRecursively(Entry entry, DirectoryEntry target)
        {
            //System.err.println("copyNodeRecursively called with "+entry.Name+
            //                   ","+target.Name);
            DirectoryEntry newtarget = null;
            if (entry.IsDirectoryEntry)
            {
                newtarget = target.CreateDirectory(entry.Name);
                IEnumerator entries = ((DirectoryEntry)entry).Entries;

                while (entries.MoveNext())
                {
                    CopyNodeRecursively((Entry)entries.Current, newtarget);
                }
            }
            else
            {
                DocumentEntry dentry = (DocumentEntry)entry;
                POIFSDocumentReader dstream = new POIFSDocumentReader(dentry);
                target.CreateDocument(dentry.Name, dstream);
                dstream.Close();
            }
        }
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:28,代码来源:POIDocument.cs


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