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

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -