Sign in to follow this  

[.net] file name

Recommended Posts

Original post by hungryhippo5000
Thank you very much. I also found another method:


The method I generally use is...

using System.IO;


FileInfo file = new FileInfo( fullName );
string fileName = file.Name;

Biggest problem is that it instantiates a FileInfo object, and returns it with an extension the same as System.IO.Path.GetFilename( FileName ). If you're doing any other manipulations to the file you might be better off with the FileInfo object for statistics, etc.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this