Archive for Luglio 15th, 2008

Dispose pattern (with comments and try{}finally block)

CodeKeep C# Feed Luglio 15th, 2008

Description: Implimentation of the IDisposable pattern with try{}finally block and comments.

Link: http://www.codekeep.net/snippets/20aba13b-423c-4d42-b556-5d83f775adb1.aspx

        ~THISCLASSNAME()
        {
            this.Dispose( false );
        }

        //-------------------------------------------------------------------
        /// <summary>
        /// Immediately releases the unmanaged resources used by this object.
        /// </summary>
        //-------------------------------------------------------------------
        public void Dispose()
        {
            this.Dispose( true );
            GC.SuppressFinalize( this );
        }

        //-------------------------------------------------------------------
        /// <summary>
        /// Releases the unmanaged resources being used and optionally releases managed resources.
        /// </summary>
        /// <param name="disposeManaged">
        /// <b>true</b> to release both managed and unmanaged resources; <b>false</b> to release only unmanaged resources.
        /// </param>
        /// <remarks>
        /// This method is called by the public Dispose method and the Finalize method. Dispose invokes the protected Dispose(Boolean) method with the <i>disposeManaged</i> parameter set to true. Finalize invokes Dispose(Boolean) with <i>disposeManaged</i> set to false. 
        /// </remarks>
        /// <seealso href="http://msdn.microsoft.com/en-us/library/fs2xkftw.aspx"/>
        //-------------------------------------------------------------------
        protected virtual void Dispose( bool disposeManaged )
        {
            try
            {
                if( true == disposeManaged )
                {
                    //
                    //  TODO: Dispose managed resources.
                    //
                }

                //
                //  TODO: Release unmanaged resources.
                //
            }
            finally
            {
                //base.Dispose( disposeManaged );
                this._disposed = true;
            }
        }

        private bool            _disposed;

How to Build a Profitable Opt-In List

WebReference News Luglio 15th, 2008

One of the most important aspects of having an online business is a good opt-in list. To have a list is one thing, to make it successful is another. In this article you'll learn how to create an opt-in list - the right way. By Christina Lang. 0527

TextBox als Passworteingabe Input

CodeKeep C# Feed Luglio 15th, 2008

Description: Zeigt an wie man eine Textbox einstellt damit man ein Element zur Passworteingabe erhält.

Link: http://www.codekeep.net/snippets/2633d336-2291-4d6e-ad86-1d9369cbfd57.aspx

// Set to no text.
textBox1.Text = "";
// The password character is an asterisk.
textBox1.PasswordChar = '*';
// The control will allow no more than 14 characters.
textBox1.MaxLength = 14;
	

Console out put

CodeKeep C# Feed Luglio 15th, 2008

Description: test

Link: http://www.codekeep.net/snippets/eed95b1d-66cc-4d48-9b73-963c40045818.aspx

            Console.Write("Press Enter to exit...");
            Console.ReadLine();