Tuesday, November 30, 2010

Calling Thread Method with Parameter

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime;
using System.Runtime.CompilerServices;
using System.Security;
using System.Text;

public class MainClass
{
    public static void Main()
    {
        Thread paramThread = new Thread(ParameterizedFunction);
        paramThread.Start("Test");

        paramThread.Join();
    }
    private static void ParameterizedFunction(string o)
    {
        Console.WriteLine("Param worker: {0}", o);
    }
}

No comments:

Post a Comment