|
Fri
Jun 30 2006 |
Quick XML Serialization |
public void SaveXml(string filename) { XmlSerializer xml = new XmlSerializer(this.GetType()); using (FileStream fs = new FileStream(filename, FileMode.Create)) { xml.Serialize(fs, this); } } public static Accounts LoadXml(string filename) { XmlSerializer xml = new XmlSerializer(typeof(Accounts)); FileInfo f = new FileInfo(filename); if (!f.Exists || f.Length == 0) return new Accounts(); using (FileStream fs = new FileStream(filename, FileMode.Open)) { return (Accounts)xml.Deserialize(fs); } } |
|
Sun
Jun 25 2006 |
Syntax Highlighting in WordPress |
|
Syntax highlighting with iG:Syntax Hiliter is mostly working now. This is the best excuse for hosting my own WordPress installation. I’ve found a few tweaks are needed to get this going:
|
|
Sun
Jun 25 2006 |
Redirect Trace Messages to a TextBox |
/// /// Outputs trace messages to a textbox. To use call /// Trace.Listeners.Add(new TextBoxTraceListener(textBox1). /// All subsequent calls to Trace.WriteLine() are copied /// to textBox1. /// public class TextBoxTraceListener : TraceListener { private TextBox textBox; /// /// Constructor /// public TextBoxTraceListener(TextBox p_textBox) { textBox = p_textBox; } /// /// Write a message to the textbox /// public override void Write(string message) { textBox.Text += message.Replace("\n", "\r\n"); } /// /// Write a message with newline to the textbox /// ///<param name="message" /> public override void WriteLine(string message) { this.Write(message + "\n"); } } |
|
Sun
Jun 25 2006 |
Setting up WordPress on WinXP |
|
Getting WordPress running on WinXP was surprisingly easy. Here are my notes on the install.
Installing PHP on IIS
Installing MySql
Create a WordPress database
Setup WordPress
Enable Permalinks in WordPress with IIS
Some other good articles on setting up WordPress, PHP, MySQL: |