Handling files in c#

less than 1 minute read

search subdirectories recursively

You can use Directory.GetFiles that searches subdirectories for you.(https://stackoverflow.com/questions/9830069/searching-for-file-in-directories-recursively/9830116)

string[] files = Directory.GetFiles(sDir, 
  "*.xml", 
  SearchOption.AllDirectories);

get full path from relative path

Path.GetFullPath(".\\EventsData\\Events.dll")

Categories:

Updated:

Comments