9
Easy to use tips and articles on VB.NET
Wednesday, February 09, 2011Posted by admin
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
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.