Created
July 26, 2019 13:02
-
-
Save PreyK/cd9243a1d1f536f04838fb37d3aacf67 to your computer and use it in GitHub Desktop.
c# uj thread
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading; | |
namespace Threading | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
//ez indit el egy uj threadet | |
Thread thr = new Thread(new ThreadStart(SecondThreadWorker)); | |
thr.Start(); | |
} | |
//ez fog futni az uj threaden | |
static void SecondThreadWorker() | |
{ | |
Console.WriteLine("Hello From another thread!"); | |
//innen igy tudod elerni a formot mer nem lehet cross-thread modositani: | |
//this.Invoke(new Action(() => MetodusAmiUpdateliAzUI-t(parameterek pl. szenzor data))); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment