DATA DE CRIACAO DE ARQUIVO
estou precisando de um código que lê a data de criação, modificação e acesso, ....
tinha um exemplo aki no site num listview, só que eu naum achei ele aki de novo ....
alguem pode passar algum link????
Citação:Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim nomearq As String
If TextBox1.Text <> [Ô][Ô] Then
If File.Exists(TextBox1.Text) Then
Dim fvi As FileVersionInfo = FileVersionInfo.GetVersionInfo(TextBox1.Text)
Me.ListBox1.Items.Clear()
Me.ListBox1.Items.Add(New String(TextBox1.Text))
Me.ListBox1.Items.Add(New String([Ô]Data da criação : [Ô] & File.GetCreationTime(TextBox1.Text)))
Me.ListBox1.Items.Add(New String([Ô]Último acesso : [Ô] & File.GetLastAccessTime(TextBox1.Text)))
Me.ListBox1.Items.Add(New String([Ô]Última alteração : [Ô] & File.GetLastWriteTime(TextBox1.Text)))
Me.ListBox1.Items.Add(New String([Ô]Nome da Empresa : [Ô] & fvi.CompanyName))
Me.ListBox1.Items.Add(New String([Ô]Versão : [Ô] & fvi.FileVersion))
Me.ListBox1.Items.Add(New String([Ô]Descrição : [Ô] & fvi.FileDescription))
Else
MessageBox.Show([Ô]O Arquivo/diretório <<[Ô] & TextBox1.Text & [Ô]>> não existe, Verifique !![Ô],
[Ô]VB.NET - Criando Diretórios[Ô], MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
Else
MessageBox.Show([Ô]Informe o caminho e nome do diretorio para exibir atributos ![Ô],
[Ô]VB.NET - Criando Diretórios[Ô], MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End If
End Sub
O UNICO PROBLEMA E QUE QDO APERTO O BOTÃO DIREITO DO MOUSE ........ VOU EM PROPRIEDADES ...... EAEEE DA UMA DIFERENÇA DE 3 HORAS, EM RELAÇÃO AO CONTEUDO EXIBIDO PELO WINDOWS E O PROGRAMA DE BAIXEI ........... RSRS
faArchive = &H20&
faCompressed = &H800&
faDirectory = &H10&
faHidden = &H2&
faNormal = &H80&
faReadOnly = &H1&
faSystem = &H4&
faTemporary = &H100&
End Enum
Public Enum EFileAccessModes
famQuery = 0&
famGenericRead = &H80000000
famGenericWrite = &H40000000
famGenericExecute = &H20000000
famGenericAll = &H10000000
End Enum
Public Enum EFileShareModes
fsmShareNone = 0&
fsmShareRead = 1&
fsmShareWrite = 2&
fsmShareDelete = 4&
End Enum
Public Enum EFileCreationMode
fcmCreateNew = 1&
fcmCreateAlways = 2&
fcmOpenExisting = 3&
fcmOpenAlways = 4&
fcmTruncateExisting = 5&
End Enum
Private Type TFileTime
dwLowDateTime As Long
dwHighDateTime As Long
End Type
Private Type TSystemTime
wYear As Integer
wMonth As Integer
wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer
wSecond As Integer
wMilliseconds As Integer
End Type
Private Declare Function CreateFile Lib [Ô]kernel32[Ô] Alias [Ô]CreateFileA[Ô] (ByVal lpFileName As String, ByVal dwDesiredAccess As Long, ByVal dwShareMode As Long, lpSecurityAttributes As Any, ByVal dwCreationDisposition As Long, ByVal dwFlagsAndAttributes As Long, ByVal hTemplateFile As Long) As Long
Private Declare Function CloseHandle Lib [Ô]kernel32[Ô] (ByVal hObject As Long) As Long
Private Declare Function GetFileTime Lib [Ô]kernel32[Ô] (ByVal hFile As Long, lpCreationTime As TFileTime, lpLastAccessTime As TFileTime, lpLastWriteTime As TFileTime) As Long
Private Declare Function FileTimeToSystemTime Lib [Ô]kernel32[Ô] (lpFileTime As TFileTime, lpSystemTime As TSystemTime) As Long
Private Sub cmdCommand1_Click()
Dim FileName As String
Dim hFile As Long
Dim ftFileCreation As TFileTime
Dim ftFileLastAccess As TFileTime
Dim ftFileLastWrite As TFileTime
Dim stFileCreation As TSystemTime
Dim stFileLastAccess As TSystemTime
Dim stFileLastWrite As TSystemTime
Dim a, b, c
[ô]FileName = [Ô]c:\autoexec.bat[Ô]
hFile = CreateFile(FileName, famGenericRead, fsmShareRead, ByVal 0&, fcmOpenExisting, faNormal, 0&)
If hFile = -1 Then Exit Sub
GetFileTime hFile, ftFileCreation, ftFileLastAccess, ftFileLastWrite
CloseHandle hFile
FileTimeToSystemTime ftFileCreation, stFileCreation
FileTimeToSystemTime ftFileLastAccess, stFileLastAccess
FileTimeToSystemTime ftFileLastWrite, stFileLastWrite
With stFileCreation
a = [Ô]FileCreation:[Ô] & Format(.wDay & [Ô].[Ô] & .wMonth & [Ô].[Ô] & .wYear & [Ô] [Ô] & .wHour & [Ô]:[Ô] & .wMinute & [Ô]:[Ô] & .wSecond, [Ô]dd.mm.yyyy hh:nn:ss[Ô])
End With
With stFileLastAccess
b = [Ô]FileLastAccess:[Ô] & Format(.wDay & [Ô].[Ô] & .wMonth & [Ô].[Ô] & .wYear & [Ô] [Ô] & .wHour & [Ô]:[Ô] & .wMinute & [Ô]:[Ô] & .wSecond, [Ô]dd.mm.yyyy hh:nn:ss[Ô])
End With
With stFileLastWrite
c = [Ô]FileLastWrite:[Ô] & Format(.wDay & [Ô].[Ô] & .wMonth & [Ô].[Ô] & .wYear & [Ô] [Ô] & .wHour & [Ô]:[Ô] & .wMinute & [Ô]:[Ô] & .wSecond, [Ô]dd.mm.yyyy hh:nn:ss[Ô])
End With
MsgBox a & vbCrLf & b & vbCrLf & c
End Sub
fassa esta lógica
Citação:Cdec((Última alteração) +-03.00))
SÓ TA FALTANDO O
TÃtulo, autor, assunto e categoria ..... ?????????
ALGUEM AI???