コード例 #1
0
ファイル: ResponseAdapter.cs プロジェクト: bberak/Appy
 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());
 }
コード例 #2
0
ファイル: HttpFileServer.cs プロジェクト: bberak/SelfServe
        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);
        }