FileSystemInfo.CreationTime 속성
현재 FileSystemInfo 개체를 만든 시간을 가져오거나 설정합니다.
네임스페이스: System.IO
어셈블리: mscorlib(mscorlib.dll)
구문
‘선언
Public Property CreationTime As DateTime
‘사용 방법
Dim instance As FileSystemInfo
Dim value As DateTime
value = instance.CreationTime
instance.CreationTime = value
public DateTime CreationTime { get; set; }
public:
property DateTime CreationTime {
DateTime get ();
void set (DateTime value);
}
/** @property */
public DateTime get_CreationTime ()
/** @property */
public void set_CreationTime (DateTime value)
public function get CreationTime () : DateTime
public function set CreationTime (value : DateTime)
속성 값
현재 FileSystemInfo 개체를 만든 날짜와 시간입니다.
예외
예외 형식 | 조건 |
---|---|
Refresh가 데이터를 초기화할 수 없는 경우 |
|
지정된 경로가 유효하지 않은 경우(예: 매핑되지 않은 드라이브의 경로를 지정한 경우) |
|
지정된 파일이 없는 경우 |
|
현재 운영 체제가 Microsoft Windows NT 이상이 아닌 경우 |
설명
처음으로 호출될 때 FileSystemInfo는 Refresh를 호출하고 캐시된 정보를 API에 반환하여 특성 등을 가져옵니다. 다음에 호출할 때 Refresh를 호출하여 정보의 최신 복사본을 얻어야 합니다.
FileSystemInfo 개체를 포함하는 파일 시스템이 이 정보를 지원하지 않으면 이 속성 값은 Null 참조(Visual Basic의 경우 Nothing)입니다.
다음 표에서는 일반적인 예 또는 관련된 I/O 작업의 예를 보여 줍니다.
수행 작업 |
참조 항목 |
---|---|
텍스트 파일에 씁니다. |
|
텍스트 파일에서 읽습니다. |
|
파일에 텍스트를 추가합니다. |
|
파일 이름을 바꾸거나 이동합니다. |
Windows 95, Windows 98, Windows 98 Second Edition 플랫폼 참고: 이 운영 체제에서는 이 속성을 지원하지 않으므로 이 속성의 DirectoryInfo 구현은 지원되지 않습니다.
Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows CE 플랫폼 참고: 이 속성은 읽기 전용입니다.
예제
다음 예제에서는 CreationTime 속성을 보여 줍니다. 이 코드 예제는 FileSystemInfo 클래스에 대해 제공되는 보다 큰 예제의 일부입니다.
Sub DisplayFileSystemInfoAttributes(ByVal fsi As IO.FileSystemInfo)
' Assume that this entry is a file.
Dim entryType As String = "File"
' Determine if this entry is really a directory.
If (fsi.Attributes And FileAttributes.Directory) <> 0 Then
entryType = "Directory"
End If
' Show this entry's type, name, and creation date.
Console.WriteLine("{0} entry {1} was created on {2:D}", _
entryType, fsi.FullName, fsi.CreationTime)
End Sub
.NET Framework 보안
- FileIOPermission 작성 시간을 설정합니다. 연관된 열거형: FileIOPermissionAccess.Write
플랫폼
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.
버전 정보
.NET Framework
2.0, 1.1, 1.0에서 지원
.NET Compact Framework
2.0, 1.0에서 지원
참고 항목
참조
FileSystemInfo 클래스
FileSystemInfo 멤버
System.IO 네임스페이스