Ejemplo n.º 1
0
        private bool FileExists(String FileName)
        {
            SolFS.StorageSearch SearchStruct = new SolFS.StorageSearch();
            bool b = Storage.FindFirst(FileName, SolFSFileAttribute.attrAnyFile, ref SearchStruct);

            if (b)
            {
                Storage.FindClose(ref SearchStruct);
            }
            return(b);
        }
Ejemplo n.º 2
0
        private void AddSubFolders(string BasePath, NTree <VirtualDirectory> BaseNode)
        {
            NTree <VirtualDirectory> CurrentNode = null;

            SolFS.StorageSearch SearchStruct = new SolFS.StorageSearch();

            String mask = "";

            if (BasePath.Equals("\\"))
            {
                mask = "\\*";
            }
            else
            {
                mask = BasePath + "\\*";
            }

            bool b = Storage.FindFirst(mask, SolFSFileAttribute.attrAnyFile, ref SearchStruct);

            if (b == true)
            {
                while (b == true)
                {
                    if ((SearchStruct.Attributes & SolFSFileAttribute.attrDirectory) == SolFSFileAttribute.attrDirectory)
                    {
                        BaseNode.AddNode(new VirtualDirectory()
                        {
                            Name = SearchStruct.FileName, Type = NodeType.Directory
                        });;
                        CurrentNode = BaseNode;
                        AddSubFolders(SearchStruct.FullName, CurrentNode);
                    }
                    b = Storage.FindNext(ref SearchStruct);
                }
                Storage.FindClose(ref SearchStruct);
            }
        }