6
Easy to use tips and articles on VB.NET
Wednesday, February 09, 2011Posted by admin
The following function returns the file extension only. eg. using the following function GetFileExtension(“c:\test\file.aspx”) will return “.aspx” Here is the complete function, copy and paste it in your form or a module Function GetFileExtension(ByVal sFilePath As String) As String ' Dim fullPath As String = "c:\MyDirectory\MYFile.txt" Dim sExtension As String = IO.Path.GetExtension(sFilePath) Return (sExtension) End Function
Comments
Comment#23 Friday, February 11, 2011 Posted by Sumeet Singh
Simple and easy articles on practical tips in using vb.net to develop windows and ASP.NEt applications.