C# Authenticated Thread Kullanımı


Create an Asynchronous Method 

private void MyTask(string[] files)
{
  foreach (string file in files)
  {
    // a time consuming operation with a file (compression, encryption etc.)
    Thread.Sleep(1000);
  }
}

Create New Thread

using System.Threading;

Thread thread = new Thread(new ThreadStart(WorkThreadFunction));
thread.Start();

public void WorkThreadFunction()
{
  try
  {
    // do any background work
  }
  catch (Exception ex)
  {
    // log errors
  }
}

Yorumlar

Bu blogdaki popüler yayınlar

HOŞ GELDİNİZ

List String Equals