Ejemplo n.º 1
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="code"></param>
 /// <param name="extracode"></param>
 /// <param name="server"></param>
 /// <returns></returns>
 public static string BuildPage(int code, int extracode, string server)
 {
     var ErrorString = SatusCode.GetStringByCode(code, extracode);
     var ErrorPage = new HtmlPage();
     ErrorPage.head.Add(new title
     {
         new HtmlRawNode(ErrorString)
     });
     ErrorPage.body.Add(
         new HtmlParam { name = "bgcolor", value = "white" }
         );
     ErrorPage.body.AddRange(
         new List<HtmlNode>
         {
         new span
             {
                 new h1
                 {
                     new HtmlRawNode("Server Error."),
                 },
                 new hr
                 {
                     new HtmlParam { name = "width", value = "100%" },
                     new HtmlParam { name = "size", value = "1" },
                     new HtmlParam { name = "color", value = "silver" }
                 },
                 new h2
                 {
                     new i
                     {
                         new HtmlRawNode($"HTTP Error {code}- {ErrorString}.")
                     }
                 }
             },
             new hr
             {
                     new HtmlParam { name = "width", value = "100%" },
                     new HtmlParam { name = "size", value = "1" },
                     new HtmlParam { name = "color", value = "silver" }
             },
             new b
             {
                 new HtmlRawNode("Server Information:")
             },
             new HtmlRawNode($" &nbsp; {server}")
         }
     );
     return ErrorPage.ToString();
 }
Ejemplo n.º 2
0
 internal static string BuildPage(int code, int extracode = 0)
 {
     var ErrorString = SatusCode.GetStringByCode(code, extracode);
     var ErrorPage = new HtmlPage();
     ErrorPage.head.Add(new title
     {
         new HtmlRawNode(ErrorString)
     });
     ErrorPage.body.Param["bgcolor"] = "white";
     ErrorPage.body.AddRange(
         new List<HtmlNode>
         {
         new span
             {
                 new h1
                 {
                     new HtmlRawNode("Server Error."),
                 },
                 new hr
                 {
                     Param = new HtmlParam
                     {
                         { "width","100%" },
                         { "size","1" },
                         { "color","silver" },
                     }
                 },
                 new h2
                 {
                     new i
                     {
                         new HtmlRawNode($"HTTP Error {code}- {ErrorString}.")
                     }
                 }
             },
             new hr
             {
                 Param = new HtmlParam
                         {
                             { "width","100%" },
                             { "size","1" },
                             { "color","silver" },
                         }
             },
             new b
             {
                 new HtmlRawNode("Server Information:")
             },
             new HtmlRawNode($" &nbsp; {MyHttpWebServer.ServerVersion}")
         }
     );
     return ErrorPage.ToString();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// ParsePage
 /// </summary>
 /// <param name="str"></param>
 /// <returns></returns>
 public static unsafe HtmlPage ParsePage(string str)
 {
     var page = new HtmlPage();
     page = Parse(str) as HtmlPage;
     return page;
 }