I want to know how to create a List<string>
with the names of files in a given directory.
The service is hosted on a shared server, published in my httpdocs
.
I have several images within httpdocs/img/imagens
.
How do I access this directory?
Controller code:
DirectoryInfo diretorio = new DirectoryInfo("~/img/imagens/");
FileInfo[] arquivos = diretorio.GetFiles();
Error:
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">
Could not find a part of the path 'C:\Windows\SysWOW64\inetsrv\~\img\imagens'.
</string>