Search this blog

Monday, June 1, 2009

Extract FileName from Path - VB.NET or C#

You can Extract the Filename by using Path Class from System.IO

C#:

using System.IO;

string filename = Path.GetFileName(@"D:\My Documents\myimg.jpg");

VB .NET:

Imports System.IO

Dim fileName As String = Path.GetFIleName("D:\My Documents\myimg.jpg")

No comments:

Post a Comment