6 VB.NET Articles - How to get the file extension from the filepath
Viewing Article

Current Rating :

How to get the file extension from the filepath

Wednesday, February 09, 2011Posted by admin

Category:vb.Net Utilities
 

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

Hits:227      Current Rating :      No Of Ratings: 100      AuthorName: admin
  

Comment#23      Friday, February 11, 2011          Posted by Sumeet Singh

 
Hi this site is really great

Comments

Your Name  
 
Your Email( will not appear on page)  
Your Comments