Ejemplo n.º 1
0
        async public void handleRequest()
        {
            HttpListenerContext context = await listener.GetContextAsync();
            var requestHandler = new RequestHandler(context);
            if(requestHandler.GetPath() == "/")
            {
                requestHandler.Respond(File.ReadAllText("index.html"));
            }
            /* else if(requestHandler.GetPath() == "/img")
             {
                 addList(new RequestHandler(context));
             }
             else
             {
                 requestHandler.Respond("");
             }*/
            else
            {
                addList(requestHandler);
            }

            

            handleRequest();
        }
Ejemplo n.º 2
0
 private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     selectedItem = listBox1.SelectedItem as RequestHandler;
     if (selectedItem == null)
         return;
     Image img = selectedItem.readPost();
     pictureBox1.Image = img;
 }