Beispiel #1
0
 public void WriteTo(HttpListenerResponse destination)
 {
     destination.Cookies = Source.Cookies;
     destination.Headers = Source.Headers;
     destination.ContentType = Source.ContentType;
     destination.StatusCode = Source.StatusCode;
     destination.WriteBytes(Source.ToBytes());
 }
Beispiel #2
0
        protected virtual void OnFileFound(string filePath, HttpListenerResponse response)
        {
            Log("Client requested file ({0})... Found", filePath);

            var file = File.ReadAllBytes(filePath);

            response.ContentType = GetContentType(filePath);
            response.WriteBytes(file);
        }