0
My project is running perfectly, but I’d like to replace that path DirectoryInfo
to another who pulls himself straight from the folder without using my directory.
Code:
public List<Arquivos> GetArquivos()
{
List<Arquivos> lstArquivos = new List<Arquivos>();
//DirectoryInfo dirInfo = new DirectoryInfo(HostingEnvironment.MapPath("~/Arquivos"));
DirectoryInfo dirInfo = new DirectoryInfo("C:/Users/Usuario/source/repos/FEESC/FEESC/UploadedFiles");
int i = 0;
foreach (var item in dirInfo.GetFiles())
{
lstArquivos.Add(new Arquivos()
{
arquivoID = i + 1,
arquivoNome = item.Name,
arquivoCaminho = dirInfo.FullName + @"\" + item.Name
});
i = i + 1;
}
return lstArquivos;
}
"pull directly from folder" q folder ? this is web or winforms ?
– Rovann Linhalis
It’s ASP.NET MVC but I don’t want to have to use the whole directory wanted to make a ~/Uploadfile
– Gustavo Rosauro