how to get filename using c# | Coding Cluster - using asp.net, c#, mvc 4, iphone, php, ios, javascript, in asp.net mvc 3 & more
 

how to get filename using c#

Saturday

get filename from filepath - C# / C Sharp
                                                              The following simple C# code is used to Extract file name from a given path. Here I'm using the Substring() method to get the filename.

Code:
string strFileName = FileInput.PostedFile.FileName.ToLower;
if (strFileName.IndexOf("\\") > -1) {
 strFileName = strFileName.Substring(strFileName.IndexOf("\\"));
}

0 comments:

Post a Comment

Share your thoughts here...

 
 
 

RECENT POSTS

Boost

 
Blogger Widgets