From c41f1374ef24c092008861fc75069ae907fd045a Mon Sep 17 00:00:00 2001 From: sta Date: Fri, 23 Jun 2017 15:39:35 +0900 Subject: [PATCH] [Modify] Replace it --- Example3/Program.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Example3/Program.cs b/Example3/Program.cs index 29333f2e..f314b5e9 100644 --- a/Example3/Program.cs +++ b/Example3/Program.cs @@ -93,8 +93,8 @@ namespace Example3 if (path == "/") path += "index.html"; - var content = httpsv.GetFile (path); - if (content == null) { + byte[] contents; + if (!e.TryReadFile (path, out contents)) { res.StatusCode = (int) HttpStatusCode.NotFound; return; } @@ -108,7 +108,7 @@ namespace Example3 res.ContentEncoding = Encoding.UTF8; } - res.WriteContent (content); + res.WriteContent (contents); }; // Add the WebSocket services.