FileInfo可以获取具体文件的属性 有没有办法获取文件所在目录的属性呢?
当前代码如下:
With e.Form
Dim dlg As New OpenFileDialog
dlg.Filter= "所有文件(*.*)|*.*"
If dlg.ShowDialog = DialogResult.Ok Then
Dim t2 As WinForm.TextBox = e.Form.Controls("TextBox2")
Dim t3 As WinForm.TextBox = e.Form.Controls("TextBox3")
t2.Text=""
t3.Text=""
.Controls("TextBox1").value = dlg.FileName
Dim ifo As new FileInfo(dlg.FileName)
Dim s As String
s="检测【文件名称】:" & ifo.Name
s= S & Chr(13) & Chr(10) & "文件创建时间:" & ifo.CreationTime
s=S & Chr(13) & Chr(10)& "上次修改时间:" & ifo.LastWriteTime
s=S & Chr(13) & Chr(10)& "上次访问时间:" & ifo.LastAccessTime
s=S & Chr(13) & Chr(10)& "是否只读:" & ifo.ReadOnly
s=S & Chr(13) & Chr(10)& "是否隐藏:" & ifo.Hidden
s=S & Chr(13) & Chr(10)& "文件路径:" & ifo.Path
s=S & Chr(13) & Chr(10)& "文件大小:" & ifo.Length
s=S & Chr(13) & Chr(10)& "扩展名:" & ifo.Extension
s=S & Chr(13) & Chr(10)& "检测【操作时间】:" & Date.now
output.show(s)
t2.text=s
Dim ifo1 As new FileInfo(ifo.Path)
Dim s1 As String
s1="检测【文件名称】:" & ifo1.Name
s1= S1 & Chr(13) & Chr(10) & "文件创建时间:" & ifo1.CreationTime
s1=S1 & Chr(13) & Chr(10)& "上次修改时间:" & ifo1.LastWriteTime
s1=S1 & Chr(13) & Chr(10)& "上次访问时间:" & ifo1.LastAccessTime
s1=S1 & Chr(13) & Chr(10)& "是否只读:" & ifo1.ReadOnly
s1=S1 & Chr(13) & Chr(10)& "是否隐藏:" & ifo1.Hidden
s1=S1 & Chr(13) & Chr(10)& "文件路径:" & ifo1.Path
s1=S1 & Chr(13) & Chr(10)& "文件大小:" & ifo1.Length
s1=S1 & Chr(13) & Chr(10)& "扩展名:" & ifo1.Extension
s1=S1 & Chr(13) & Chr(10)& "检测【操作时间】:" & Date.now
output.show(s1)
t3.text=s1
End If
End With