Articles → .NET → Codeplex Syntax Highlighter
Codeplex Syntax Highlighter
Software Requirement
Prerequisite Knowledge
- Know how to create a web application (or website).
- How to add a reference in the project?
- What are namespace and class in .net?
- What is a DLL? How to use it?
What Is Syntax Highlighter?
Scenario Of Using Syntax Highlighter
Download DLL
Creation Of A Website
Click to Enlarge
Adding DLL Reference
Click to Enlarge
Click to Enlarge
Creating Text File
Click to Enlarge
Adding Code In A Web Page
using System;
using System.IO;
using ColorCode;
public partial class _Default: System.Web.UI.Page {
protected void Page_Load(object sender, EventArgs e) {
string code = File.ReadAllText(Server.MapPath(@"~\code.txt"));
string colorCode = new CodeColorizer().Colorize(code, Languages.Aspx);
Response.Write(colorCode);
}
}
Code Explained
Run Application
Click to Enlarge
Conclusion