jango_fett
Member
- Joined
- Jun 15, 2005
- Messages
- 23
- Programming Experience
- Beginner
Tiny problem with file extensions - [RESOLVED]
Hi, there. I have created a function that returns a list of files within a specified directory. The IO.FileInfo.Name property is adequate because through it I can obtain only the names of the files without its whole path from root. However, it still gives away the files' extension. Is there a way to show only the names without the extensions? Here's the function I' created. Many thanks.
Hi, there. I have created a function that returns a list of files within a specified directory. The IO.FileInfo.Name property is adequate because through it I can obtain only the names of the files without its whole path from root. However, it still gives away the files' extension. Is there a way to show only the names without the extensions? Here's the function I' created. Many thanks.
HTML:
Private Function ListAllFileNames(ByVal MyDir As String) As ArrayList
Dim MyList As New ArrayList, MyInfo As IO.FileInfo
If IO.Directory.Exists(MyDir) Then
Dim MyFiles() As String = IO.Directory.GetFiles(MyDir)
For Each MyFile As String In MyFiles
MyInfo = New IO.FileInfo(MyFile)
MyList.Add(MyInfo.Name)
Next
End If
Return MyList
End Function
Last edited: