Example #1
0
 void Button4Click(object sender, EventArgs e)
 {
     foreach (string resource in EmbeddedResource.GetAllResources())
     {
         System.Diagnostics.Debug.WriteLine(resource);
     }
 }
Example #2
0
        public HttpCache(HttpServer server)
        {
            this.cache  = new Dictionary <string, HttpCachedFile>();
            this.server = server;

            // read all embedded resources
            foreach (var file in EmbeddedResource.GetAllResources())
            {
                var request = file.ToLower();
                cache.Add(request, new HttpCachedEmbeddedFile(file));
            }

            // read all files on root folder
            foreach (var file in IO.GetAllFiles(server.Root))
            {
                var request = file.Substring(server.Root.Length + 1).ToLower();
                cache.Add(request, new HttpCachedFile(file));
            }
        }