Archive for February, 2006

Set access permissions for Microsoft Word

To access Word from an ASP.NET application, the right access permissions have to be set. When trying to open a Word document from an ASP.NET application, using the this code… Line 50: private void btnWord_Click(object sender, System.EventArgs e) Line 51: { Line 52: Word.ApplicationClass WordApp = new Word.ApplicationClass(); Line 53: WordApp.Visible = true; Line 54: [...]

More »

InputBox (c#)

In VB6 and VB.NET there is a handy InputBox to prompt the user for small pieces of information. In C# this class is absent. With the code below you can easily create something like this: Here’s the code… using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; /// /// Summary description for InputBox. /// [...]

More »

Singleton (c#)

Making a singleton in C#. /// /// Simple singleton example. /// See http://www.yoda.arachsys.com/csharp/singleton.html /// for more information. /// public class Singleton { // singleton instance private static Singleton instance = null; // object for locking between threads static readonly object padlock = new object(); // get singleton instance public static Singleton Instance { get { [...]

More »