This is the line:
string t = Path.GetDirectoryName(file1);
The result is:
C:\\Users\\bout0_000\\AppData\\Local\\Extracting_Frames\\Extracting_Frames\\dat file\\converted.avi\\histogramValues.dat
I want it to only contain: converted.avi.
PS: converted.avi is not a file name it’s a path name. I want to get the last part of the path the last subdirectory without the file name.
if
converted.aviis the file name then use thisDocs: http://msdn.microsoft.com/en-gb/library/system.io.path.getfilename.aspx
However, if that is the name of a directory, you could just extract everything after the last backslash from the result you already have. eg
Live example: http://rextester.com/RYPMI91227