Example #1
0
        static void HandleOff(RequestHandlerContext context)
        {
            lightWrite(false);
            string s = "<h1>OFF " + DateTime.Now.ToString();

            context.SetResponse(s, "text/html");
        }
Example #2
0
        static void HandleToggle(RequestHandlerContext context)
        {
            lightWrite(!lOn);
            string s = "<h1>Toggle -- was on: " + (!lOn).ToString() + " " + DateTime.Now.ToString();

            context.SetResponse(s, "text/html");
        }
Example #3
0
        private static void Handler(RequestHandlerContext context)
        {
            const string defaultPageName = "index.html";
            var          path            = context.RequestUri;


            var suffix = path == string.Empty ? defaultPageName : path.Substring(1);

            context.SetResponse("hello", "text/plain");
        }
Example #4
0
 static void HandleGetHelloHtml(RequestHandlerContext context)
 {
     string s =
         "<html>\r\n" +
         "\t<body>\r\n" +
         "\t\tHello <strong>Web</strong> at " +
             DateTime.Now + "\r\n" +
         "\t</body>\r\n" +
         "</html>";
     context.SetResponse(s, "text/html");
 }