9 VB.NET Articles - Extract the file name from the complete file path
Viewing Article

Current Rating :

Extract the file name from the complete file path

Wednesday, February 09, 2011Posted by admin

Category:vb.Net Utilities
 

Sometimes there is a need to get the file name from the complete path name Use the following function If you pass URL as “http:/vbnet.redirect.com.au/defaul.aspx ” the following function will return “default.aspx” Function GetFileNamefromURL(ByVal URL String) As String Return FILEPath.Substring(FILEPath.LastIndexOf("/") + 1) End Function In this function if you pass "c:\temp\myfile.txt" it will return "myfile.txt" Function GetFileNamefromFileSystemPath(ByVal FILEPath As String) As String Return FILEPath.Substring(FILEPath.LastIndexOf("\") + 1) End Function

Hits:198      Current Rating :      No Of Ratings: 31      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