I made an application that search for some files in some directories. When a directory isn’t there it throws the DirectoryNotFoundException. I catch that exception but it doesn’t have a DirectoryName property or something like that like the FileNotFoundException (FileName). How can I find the Directory Name from the exception properties?
I made an application that search for some files in some directories. When a
Share
There’s no way to natively do this.
Add this class somewhere to your project:
Catch the exception and use the type extension like this: