Israel Aéce

Microsoft MVP, MCP, MCAD, MCTS, MCPD e MCT

My Links

Blog Stats

Archives

Post Categories

Links

Login

squishySyntaxHighlighter

Navegando pela web, encontrei um componente bastante interessante chamado squishySyntaxHighlighter, onde dado uma string contendo o código em VB.NET, C# ou XML ele retorna o mesmo código mas agora em um formato similar ao que temos no Visual Studio .NET, e incluindo também a numeração de linhas e preservando as Regions que colocamos no mesmo.

O código para usá-lo é bem simples, como é mostrado abaixo:

     Imports System.IO
     Imports Squishyware.Text.SyntaxHighlighting
     '...
     '...
     Dim sb As New StreamReader(Server.MapPath("WebForm1.aspx.vb"))
     Dim s As String = sb.ReadToEnd()
     sb.Close()
     '...
     Dim sh As SyntaxHighlighter
     sh = SyntaxHighlighter.GetHighlighter(SyntaxType.VisualBasic)
     Response.Write(sh.Highlight(s))

Para saber mais sobre ele, temos aqui os links:

posted on Sunday, May 22, 2005 4:26 PM

Feedback

No comments posted yet
Title  
Name  
Url
Box Code
Protected by FormShield
Comments