Below is a code that demonstrates how to create a Thread Delegate, which calls a function that will do some work for you in the background.

        static void Main(string[] args)
        {
            // Creating a thread Delegate
            System.Threading.Thread _thread = new System.Threading.Thread(new System.Threading.ThreadStart(FuctionDoBackgroundWork));
            _thread.Start();

        }
        // Fucntion that the thread delegate Starts
        public static void FuctionDoBackgroundWork()
        {
            // Background work goes here
        }

More C# Snippets

Last modified: May 16, 2019