Imports DTG.Html Imports DTG.Css Imports System.IO Module Module1 Sub Main() Dim snippet As String = "" + _ "" + _ "" + _ "Html Parser + CSS Parser for .NET" + _ "" ' Parse the html Dim html As HtmlDoc = HtmlDoc.ParseHTML(snippet) ' Get css stylesheet Dim tableList As HtmlNodeCollection = html.Nodes.FindByName("style") Dim styles As String = CType(tableList(0), HtmlTag).Text ' Parse the css Dim css As CssDocument = CssDocument.ParseCSS(styles) ' Save css as an html Dim htmlrender As String = HtmlRenderer.Render(css) Dim htmlfile As StreamWriter = New StreamWriter("..\..\..\htmlrender.html") htmlfile.Write(htmlrender) htmlfile.Close() ' show the html file System.Diagnostics.Process.Start("..\..\..\htmlrender.html") End Sub End Module