[ASP.NET] Elenco files in una directory

Problema: avere l’elenco dei file presenti in una certa directory sul nostro server

Soluzione C#:

DirectoryInfo di = new DirectoryInfo("c:/inetpub/wwwroot/demos");
FileInfo[] rgFiles = di.GetFiles("*.aspx");
foreach(FileInfo fi in rgFiles)
{
Response.Write("
" + fi.Name + "");
}

Commenti

commenti

3 pensieri su “[ASP.NET] Elenco files in una directory”

  1. Pingback: elchinas
  2. Pingback: AlexanderGreat
  3. you wanna read more about what exactly?
    they are little tips, but if you want more pls tell me about exactly and i will write ๐Ÿ˜‰
    byeeeezzzzzzz

Lascia un commento