using System.Collections;using System.IO;using System.Web;public class ListFiles{ public static ICollection ListUploadDirectory() { DirectoryInfo d = new DirectoryInfo(System.Web.HttpContext.Current.Server.MapPath("~/Upload"));//Folder from where you want to retrieve files return d.GetFileSystemInfos("*.jpg");//type of files which you want to retrieve }}