コード例 #1
0
        public void ScanItemN()
        {
            FileFindNat find = new FileFindNat(DirectoryNat.MakeUniversalPath(root.basePath + relPath + "*"));
            bool        findOK;

            findOK = find.Next();
            // Error if not found on first item
            if (!findOK)
            {
                throw new Exception("First filefind failed");
            }

            while (findOK)
            {
                if (find.IsDirectory)
                {
                    if (find.Name != "." && find.Name != "..")
                    {
                        if (childs == null)
                        {
                            childs = new List <FileInfo>();
                        }
                        childs.Add(new FileInfo(this, find.Name, find.CreationTimeUtc));
                    }
                }
                else
                {
                    if (files == null)
                    {
                        files = new List <FileInfo>();
                    }
                    files.Add(new FileInfo(this, find.Name, find.CreationTimeUtc, find.LastWriteTimeUtc, find.Attributes, find.Length));
                }

                findOK = find.Next();
            }
            find.Dispose();
        }
コード例 #2
0
ファイル: FileInfo.cs プロジェクト: JPlenert/Pro2
		public void ScanItemN()
		{
			FileFindNat find = new FileFindNat(DirectoryNat.MakeUniversalPath(root.basePath + relPath + "*"));
			bool findOK;

			findOK = find.Next();
			// Error if not found on first item
			if (!findOK)
				throw new Exception("First filefind failed");

			while (findOK)
			{
				if (find.IsDirectory)
				{
					if (find.Name != "." && find.Name != "..")
					{
						if (childs == null)
							childs = new List<FileInfo>();
						childs.Add(new FileInfo(this, find.Name, find.CreationTimeUtc));
					}
				}
				else
				{
					if (files == null)
						files = new List<FileInfo>();
					files.Add(new FileInfo(this, find.Name, find.CreationTimeUtc, find.LastWriteTimeUtc, find.Attributes, find.Length));
				}

				findOK = find.Next();
			}
			find.Dispose();
		}