c# - Get file path if file is in another folder -


i have text file inside drive. inside folder in drive. know filename , drive name. searches file occurance through

var file = directory.getfiles(ftppath,filename,searchoption.alldirectories);

that ok. if file in folder under drive how ne path in ftppath variable?

i not find valid solution this.

it should like:

ftppath = path.getdirectoryname(file[0]); 

now path in filename found in stored in ftppath. of course should add checks before accessing file ensure found...


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -