How to get the file name from a full file path?
If you have a full file path like D:\My Documents\myimg.jpg and you want to get just the file name myimg.jpg, you can get it with the help of the Path class in this fashion:-
In C#
string filename = Path.GetFileName(“D:\My Documents\myimg.jpg“);
In VB .NET
Dim fileName as String = Path.GetFIleName(“D:\My Documents\myimg.jpg”)
Categories: ASP .NET, C#, VB .NET
ASP .NET, file name from file path, Getting File name, Path

