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:
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...