enter image description here I get only the relative path of the directory/folders but not of the files in it? I can't really find the bug... . I do not understand why it won't get the relative path of the files but of the folders it will.
From MSDN :
Directory.GetFiles Method (String)
Returns the names of files (including their paths) in the specified directory.
So you should do this:
foreach(string filename in Directory.GetFiles(path))
{
result.Append(Path.GetFileName(filename), "FILE");
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.