class listenToHTTP { HttpListener _listner; public void start() { _listner = new HttpListener(); _listner.Prefixes.Add("http://localhost/");//default port 80 _listner.Start(); } public void process() { while (true) { HttpListenerContext context = _listner.GetContext(); byte[] output = Encoding.ASCII.GetBytes("HELLO THERE"); context.Response.ContentEncoding = Encoding.ASCII; context.Response.ContentLength64 = output.Length; context.Response.OutputStream.Write(output, 0, output.Length); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)