Horje
c# thread wait Code Example
c# Sleep
using System.Threading;

static void Main()
{
  //do stuff
  Thread.Sleep(5000) //will sleep for 5 sec
}
c# thread wait
Thread.Sleep(2000); //in ms
import time C#
using system.Threading //Thread.sleep
c# thread wait

public class Form1 : Form
{
    int _count;

    void ButtonClick(object sender, EventArgs e)
    {
        ThreadWorker worker = new ThreadWorker();
        worker.ThreadDone += HandleThreadDone;

        Thread thread1 = new Thread(worker.Run);
        thread1.Start();

        _count = 1;
    }

    void HandleThreadDone(object sender, EventArgs e)
    {
        // You should get the idea this is just an example
        if (_count == 1)
        {
            ThreadWorker worker = new ThreadWorker();
            worker.ThreadDone += HandleThreadDone;

            Thread thread2 = new Thread(worker.Run);
            thread2.Start();

            _count++;
        }
    }

    class ThreadWorker
    {
        public event EventHandler ThreadDone;

        public void Run()
        {
            // Do a task

            if (ThreadDone != null)
                ThreadDone(this, EventArgs.Empty);
        }
    }
}

Source: devarama.com




Csharp

Related
stock span problem c# Code Example stock span problem c# Code Example
How do I remove all non alphanumeric characters from a string? Code Example How do I remove all non alphanumeric characters from a string? Code Example
avoid autocomplete input text asp.net Code Example avoid autocomplete input text asp.net Code Example
list.max c# Code Example list.max c# Code Example
c# filter non alphanumeric characters Code Example c# filter non alphanumeric characters Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9