ASP 폴더 개체
Folder Object는 지정된 폴더에 대한 정보를 반환하는 데 사용됩니다.
폴더 객체
Folder 개체는 지정된 폴더에 대한 정보를 반환하는 데 사용됩니다.
Folder 개체의 속성과 메서드를 사용하려면 FileSystemObject 개체를 통해 Folder 개체의 인스턴스를 만들어야 합니다. 첫 번째; FileSystemObject 개체를 만든 다음 FileSystemObject 개체의 GetFolder 메서드를 통해 Folder 개체를 인스턴스화합니다.
다음 코드는 FileSystemObject 개체의 GetFolder 메서드를 사용하여 Folder 개체를 인스턴스화하고 DateCreated 속성을 사용하여 지정된 폴더가 생성된 날짜를 반환합니다.
<%
Dim fs,fo
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Set fo=fs.GetFolder("c:\test")
Response.Write("Folder created: " & fo.DateCreated)
set fo=nothing
set fs=nothing
%>
Output:
Folder created: 10/22/2008 10:01:19 AM
Folder 개체의 컬렉션, 속성 및 메서드는 아래에 설명되어 있습니다.
컬렉션
Collection | Description |
---|---|
Files | Returns a collection of all the files in a specified folder |
SubFolders | Returns a collection of all subfolders in a specified folder |
속성
Property | Description |
---|---|
Attributes | Sets or returns the attributes of a specified folder |
DateCreated | Returns the date and time when a specified folder was created |
DateLastAccessed | Returns the date and time when a specified folder was last accessed |
DateLastModified | Returns the date and time when a specified folder was last modified |
Drive | Returns the drive letter of the drive where the specified folder resides |
IsRootFolder | Returns true if a folder is the root folder and false if not |
Name | Sets or returns the name of a specified folder |
ParentFolder | Returns the parent folder of a specified folder |
Path | Returns the path for a specified folder |
ShortName | Returns the short name of a specified folder (the 8.3 naming convention) |
ShortPath | Returns the short path of a specified folder (the 8.3 naming convention) |
Size | Returns the size of a specified folder |
Type | Returns the type of a specified folder |
행동 양식
Method | Description |
---|---|
Copy | Copies a specified folder from one location to another |
Delete | Deletes a specified folder |
Move | Moves a specified folder from one location to another |
CreateTextFile | Creates a new text file in the specified folder and returns a TextStream object to access the file |