|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Text.RegularExpressions;
namespace SideBySideTextBox
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
using (TextReader tr = new StreamReader(@"c:\1.sql"))
{
sideBySideRichTextBox1.LeftText = tr.ReadToEnd();
}
using (TextReader tr = new StreamReader(@"c:\2.sql"))
{
sideBySideRichTextBox1.RightText = tr.ReadToEnd();
}
sideBySideRichTextBox1.CompareText();
}
private void button1_Click(object sender, EventArgs e)
{
StringTokenizer st = new StringTokenizer("/* this is a\ncomment */hello--comment to eof\nSELECT ((a*b)+c)/d as wack");
Token t;
while ((t = st.Next()) != null)
{
MessageBox.Show(t.Kind.ToString() + " -> " + t.Value);
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I started using computers when I was 6. It was all downhill from there!