Unfortunately, for some reason the `<` and `>` are being converted to `<` and `>` before it gets turned into HTML, which exposes all the HTML code as text and simply doesn't work. I have tried looking into the WebBrowser control and stuff but I don't understand what I'm supposed to do. For example, I tried this from a site: WebBrowser browser = new WebBrowser(); browser.Navigate("about:blank"); browser.Document.Write(Server.HtmlEncode(line)); ...but it didn't work. I'm looking for something very simple and with a clear example I can mimic, if possible. Thanks! I will make sure to select an answer too.
以上就是How to display HTML tags properly from a text file using C#?的详细内容，更多请关注web前端其它相关文章！