Du bist hier: Snippet-Verzeichnis » Microsoft .NET (154)
Sprache:

Change File Informations

Sprache: English
Programmiersprache: VB.NET
Veröffentlicht von: Olaf [nicht registriert]
Letzte Änderung: 04.05.2006
Aufrufe: 1320

Beschreibung

Change file informations "Created at", "Modified at" and "Last Accessed at"

Code

1 Try 2 3 With Me.OpenFileDialog() 4 .Multiselect = False 5 .Filter = "All Files (*.*)|*.*" 6 .RestoreDirectory = True 7 .CheckFileExists = True 8 .CheckPathExists = True 9 .Title = "Choose a File" 10 .ShowDialog() 11 12 If .FileName <> "" Then 13 fi = New FileInfo(.FileName) 14 15 With fi 16 .CreationTimeUtc = CDate(Me.txtCreatedAt.Text) 17 .CreationTime = CDate(Me.txtCreatedAt.Text) 18 .LastWriteTimeUtc = CDate(Me.txtChangedAt.Text) 19 .LastWriteTime = CDate(Me.txtChangedAt.Text) 20 .LastAccessTimeUtc = CDate(Me.txtLastAccessed.Text) 21 .LastAccessTime = CDate(Me.txtLastAccessed.Text) 22 End With 23 24 MsgBox("Done!", MsgBoxStyle.Information, "Information") 25 End If 26 27 End With 28 29 Catch ex As Exception 30 31 MsgBox("Upps ...an error!" & vbCrLf & vbCrLf & ex.Message & " " & Err.Description, MsgBoxStyle.Critical, ex.Source) 32 33 End Try

Ein Kommentar

1

It is possible to get and set the Archiv-Bit?

Mittwoch, 10. Mai 2006 13:45:57 von memoryleak

Dieses Snippet kommentieren

Name *  

E-Mail (wird nicht angezeigt) *    

Website  

Kommentar *  

Sicherheitscode Sicherheitscode *    

RSS