========================================
C#反射和特性
========================================
反射Reflection
Type 类型
Name
NameSpace
Assembly
GetFields()
GetProperties()
GetMethods()
特性Attribute
Obsolete弃用
Conditional有条件的
Caller调用方
CallerLineNumber
CallerFilePath
CallerMemberName
DebuggerStepThrough 调试时跳过
其他
程序集
dll
exe
========================================
C#委托和事件
========================================
委托delegate
系统内部委托类型
Action无返回类型
Func一个返回类型
自定义委托类型
事件event
系统内部委托类型
EventHandler
自定义委托类型
其他
委托可以外部调用
事件不能外部调用
========================================
C#文件操作
========================================
目录Directory
Directory
Exists
CreateDirectory
DirectoryInfo
文件File
File
FileInfo
FileStream
Close
ReadByte
WriteByte
读取Read
StreamReader
EndOfStream
Read
ReadLine
BinaryReader
StringReader
写入Write
StreamWriter
Write
WriteLine
BinaryWriter
StringWriter
其他
// ..\ 父目录
========================================
C#文件类型
========================================
日志(.txt)
轻量级数据(.csv、.xml)
数据库(SQLite)
========================================
C#线程
========================================
线程Thread
Thread(Method)
线程池ThreadPool
ThreadPool.QueueUserWorkItem
任务Task
Task.Factory.StartNew
其他
lock
lock资源冲突问题,顺序lock死锁问题
令牌运行和取消线程CancellationTokenSource
线程同步ManualResetEventAutoResetEvent
Set
Reset
WaitOne
手动一次可以唤醒多个线程
自动一次只唤醒一个线程