Esempio n. 1
0
        public void Read()
        {
            if (hostControl != null)
            {
                if (string.IsNullOrEmpty(path))
                {
                    path = "~/";
                }
                path = hostControl.ResolveClientUrl(path);
                DirectoryInfo di = new DirectoryInfo(hostControl.Server.MapPath(path));

                if (string.IsNullOrEmpty(searchPatterns))
                {
                    searchPatterns = "*.*";
                }
                string[] pats = searchPatterns.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
                for (int i = 0; i < pats.Length; i++)
                {
                    foreach (FileInfo var in di.GetFiles(pats[i]))
                    {
                        fi.Add(new WebFileInfoWrapper(var, path));
                    }
                }
            }
        }