C# - Problem while listing directories - DirectoryNotFoundException
Posted
by HoNgOuRu
on Stack Overflow
See other posts from Stack Overflow
or by HoNgOuRu
Published on 2010-04-18T16:00:51Z
Indexed on
2010/04/18
16:03 UTC
Read the original article
Hit count: 305
I'm getting a "DirectoryNotFoundException" error, here is the code:
string directorio = "D:\MUSICA\La Trampa - El Mísero Espiral De Encanto"; DirectoryInfo dir = new DirectoryInfo(directorio); DirectoryInfo[] dirs = dir.GetDirectories(); <------------This is the line I'm having this problem.
I believe it's caused when it tries to parse the tilde part of that string "Mísero". the directory "D:\MUSICA\La Trampa - El Mísero Espiral De Encanto" exists because I can see it and also have some files in it. Is there any way to send this string in correct way?
Thanks
© Stack Overflow or respective owner