Пример #1
0
        internal static Page LoadOrCreateSpecial(HTTPCode code)
        {
            string loc = "specials/" + code.SpecialLocation;
            if (System.IO.File.Exists(loc + ".dll"))
            {
                return LoadGenerator(loc + ".dll");
            }
            else if (System.IO.File.Exists(loc + ".html"))
            {
                return LoadFlat(loc + ".html");
            }
            else
            {

            }
        }
Пример #2
0
        internal static IPage LoadOrCreateSpecial(HTTPCode code)
        {
            string loc = "specials/" + code.SpecialLocation;
            if (System.IO.File.Exists(loc + ".dll"))
            {
                return LoadGenerator(loc + ".dll");
            }
            else if (System.IO.File.Exists(loc + ".html"))
            {
                return LoadFlat(loc + ".html");
            }
            else
            {
                using (var r = Assembly.GetExecutingAssembly().GetManifestResourceStream("NetDotNet.Core.IO.Pages.DefaultSpecials." + code.SpecialLocation + ".html"))
                {
                    using (var fos = new FileStream(loc, FileMode.Create))
                    {
                        r.CopyTo(fos);
                    }
                }

                return LoadFlat(loc + ".html");
            }
        }