WPF host computer 6 - file operation, multithreading, thread lock, Task asynchronous programming

file operation

insert image description here

folder operations

insert image description here

create folder

insert image description here

insert image description here
insert image description here

disk information

insert image description here

file reading and writing

insert image description here

file stream

insert image description here
insert image description here

ThreadMultithreading

insert image description here
insert image description here

Create a thread with parameters

insert image description here

Task multithreading

Creation method 1

The first

insert image description here

the second

insert image description here

The third method: the way of thread pool

insert image description here

Foreground and background threads

insert image description here

thread lock

insert image description here
insert image description here

Task asynchronous programming

insert image description here
insert image description here
insert image description here
insert image description here
insert image description here

task task cancel

insert image description here

task return value

insert image description here

async await asynchronous

insert image description here

Parallel library Parallel

insert image description hereinsert image description here
insert image description here

Asynchronous method execution

insert image description here

Async method with return value

insert image description here

call and get the return value

insert image description here

Guess you like

Origin blog.csdn.net/qq_42832272/article/details/132064043