Update Directory: create time, last access time and last write time : Directory « File Directory « VB.Net

VB.Net
1. 2D
2. Application
3. Class
4. Data Structure
5. Database ADO.net
6. Development
7. Event
8. File Directory
9. Generics
10. GUI
11. Language Basics
12. Network Remote
13. Thread
14. Windows System
15. XML
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
VB.Net » File Directory » DirectoryScreenshots 
Update Directory: create time, last access time and last write time
Update  Directory: create time, last access time and last write time

Imports System.IO

Module Module1

    Sub Main()
        If (Directory.Exists("C:\WINNT\Temp")) Then
            Dim Dir As New DirectoryInfo("C:\WINNT\Temp")

            Dim DateTimeNow As DateTime = DateTime.Now()
            Try
                Dir.CreationTime = DateTimeNow
                Dir.LastAccessTime = DateTimeNow
                Dir.LastWriteTime = DateTimeNow

                Console.WriteLine("Directory attributes updated")
            Catch As Exception
                Console.WriteLine("Error updating attributes")
                Console.WriteLine("Error {0}: ", E.Message)
            End Try
        Else
            Console.WriteLine("C:\WINNT\Temp does not exist")
        End If

    End Sub

End Module


           
       
Related examples in the same category
1. Get all directories
2. Recursive Directory InfoRecursive Directory Info
3. Display Directory TreeDisplay Directory Tree
4. List files and directories in rootList files and directories in root
5. Directory Information: name, last update and create timeDirectory Information: name, last update and create time
6. Get Root directory and current directoryGet Root directory and current directory
7. Directory SeparatorDirectory Separator
8. Get Current DirectoryGet Current Directory
9. Get file in the parent folder Get file in the parent folder
10. Display all file under a DirectoryDisplay all file under a Directory
11. Find a file: search directory recursively
w_w__w__.__j_a_v_a2_s__.___c_om__ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.