Horje
multithreading in .net core Code Example
multithreading in .net core
static void Main(string[] args) { CancellationTokenSource tokenSource = new CancellationTokenSource(); CancellationToken token = tokenSource.Token; Task.Factory.StartNew(() => SaveFileAsync(path, bytes, token)); } static Task SaveFileAsync(string path, byte[] fileBytes, CancellationToken cancellationToken) { if (cancellationToken.IsCancellationRequested) { Console.WriteLine("Cancellation is requested..."); cancellationToken.ThrowIfCancellationRequested } //Do some file save operation File.WriteAllBytes(path, fileBytes); return Task.FromResult(0); }Copy




Csharp

Related
change true to false unity Code Example change true to false unity Code Example
c# arraylist to listview Code Example c# arraylist to listview Code Example
c# code process to start any exe application Code Example c# code process to start any exe application Code Example
how to add colider in obj in unity 2020 Code Example how to add colider in obj in unity 2020 Code Example
unity getcomponent transform.position Code Example unity getcomponent transform.position Code Example

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