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

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -