C
Carlos
I use the below codes downloaded from
http://www.visualbasicforum.com/showthread.php?t=158264 to perform a
recursive search of files and folders. I can obtain most of the information
such as the filename, last modified, last accessed, last created but I'm not
able to get the "owner" information which is the most important info that I
need to get.
I want to know who "creates" this file. By the way I use VB.NET languages
with VS.NET IDE.
Can someone enlighthen me or direct me to some sample page on how the codes
to get file information (security?)
Thanks
Carlos.
----------------------------------------------------------------
Private Overloads Function Recursive(ByVal strPath As String)
Dim oDir As New System.IO.DirectoryInfo(strPath)
Dim oSubDir() As System.IO.DirectoryInfo
Dim oFiles() As System.IO.FileInfo
Dim i As Int32
oFiles = oDir.GetFiles
For i = 0 To oFiles.Length - 1
Debug.WriteLine(oFiles(i).Name.ToString)
Next
oSubDir = oDir.GetDirectories()
For i = 0 To oSubDir.Length - 1
Debug.WriteLine(oSubDir(i).Name.ToString)
'more code to do whatever here
Call Recursive(oSubDir(i), 1)
Next
End Function
Private Overloads Function Recursive(ByVal oDir As System.IO.DirectoryInfo,
ByVal intLevel As Int32)
Dim oSubDir() As System.IO.DirectoryInfo
Dim oFiles() As System.IO.FileInfo
Dim i As Int32
oFiles = oDir.GetFiles
For i = 0 To oFiles.Length - 1
Debug.WriteLine(New String(" ", intLevel) & ">" &
oFiles(i).Name.ToString)
Next
oSubDir = oDir.GetDirectories()
For i = 0 To oSubDir.Length - 1
Debug.WriteLine(New String(" ", intLevel) &
oSubDir(i).Name.ToString)
'more code to do whatever here
Call Recursive(oSubDir(i), intLevel + 1)
Next
End Function
http://www.visualbasicforum.com/showthread.php?t=158264 to perform a
recursive search of files and folders. I can obtain most of the information
such as the filename, last modified, last accessed, last created but I'm not
able to get the "owner" information which is the most important info that I
need to get.
I want to know who "creates" this file. By the way I use VB.NET languages
with VS.NET IDE.
Can someone enlighthen me or direct me to some sample page on how the codes
to get file information (security?)
Thanks
Carlos.
----------------------------------------------------------------
Private Overloads Function Recursive(ByVal strPath As String)
Dim oDir As New System.IO.DirectoryInfo(strPath)
Dim oSubDir() As System.IO.DirectoryInfo
Dim oFiles() As System.IO.FileInfo
Dim i As Int32
oFiles = oDir.GetFiles
For i = 0 To oFiles.Length - 1
Debug.WriteLine(oFiles(i).Name.ToString)
Next
oSubDir = oDir.GetDirectories()
For i = 0 To oSubDir.Length - 1
Debug.WriteLine(oSubDir(i).Name.ToString)
'more code to do whatever here
Call Recursive(oSubDir(i), 1)
Next
End Function
Private Overloads Function Recursive(ByVal oDir As System.IO.DirectoryInfo,
ByVal intLevel As Int32)
Dim oSubDir() As System.IO.DirectoryInfo
Dim oFiles() As System.IO.FileInfo
Dim i As Int32
oFiles = oDir.GetFiles
For i = 0 To oFiles.Length - 1
Debug.WriteLine(New String(" ", intLevel) & ">" &
oFiles(i).Name.ToString)
Next
oSubDir = oDir.GetDirectories()
For i = 0 To oSubDir.Length - 1
Debug.WriteLine(New String(" ", intLevel) &
oSubDir(i).Name.ToString)
'more code to do whatever here
Call Recursive(oSubDir(i), intLevel + 1)
Next
End Function