WebHosting

Monday, January 30, 2012

Ways of passing argument to Threads in C#

image

1. The easiest way to pass arguments to a thread’s target method is to execute a lambda expression that calls the method with the desired arguments:


static void Main()
{

//We can pas a string argument like putting () in the thread initialization.
Thread t = new Thread ( () => Print ("Hello from t!") );
t.Start();
}
static void Print (string message)
{
Console.WriteLine (message);
}

With this approach, you can pass in any number of arguments to the method. You can even wrap the entire implementation in a multi-statement lambda:

new Thread (() =>{ Console.WriteLine ("I'm running on another thread!"); Console.WriteLine ("This is so easy!");}).Start();

Saturday, January 28, 2012

Windows 8 Programming Tutorials : Lets see what we can do on windows 8 and how.

Windows 8  and windows mobile 7 programming is based on (WinRT) Windows Runtime : new subsystem in Windows 8 that allows users to build touch optimized applications in the metro look and feel. It exists in parallel with other frameworks like .NET (WPF), Silverlight or native C++ and will not replace those technologies. While metro style apps are manily consumer focused - .NET and Silverlight target more on line-of-business applications.

 To develop metro style application we can use languages like c#, javascript, html, c++ too...

Featured Posts

किसके हिस्से में में ये धरती

चिड़ियों का घर जल रहा है  इंसान खुश है कि ये आग दूर है अभी कभी तो आएगी घर तक  तेरा भी घर जलेगा कभी बेजुबान है कुछ बोलते नहीं है दिल में दुख ...