Extract file name from path - 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

Related Posts Plugin for WordPress, Blogger...