For example i have a file ISample.cs in this path like
"D:\TEST_SOURCE\CV\SOURCE CODE\ARMY.Data\ProceduresALL\ISample.cs"
Here i wanna the file-path from
"ProceduresAll\ISample.cs"
Before that i don't wanna that path.Here i am using folder browser for choosing the folder.
Please help me regarding this.
You mean like this?
Use Path.Combine("ProceduresALL", "ISample.cs") to get ProceduresALL\ISample.cs (using the above to get these strings).
You could either use the string function Split to split on \ or you could use the LastIndexOf and Substring functions to chop away at the paths.
Path.GetFileName(filePath)
gets the "filename" part which is actually the last directory part asfilePath
doesn't contain a filename anymore.This should work: