![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C#
emako_
这个作者很懒,什么都没留下…
展开
-
【C#】.NET Core里读取appsettings.json方法
JSON文件:{ "ConnctionStrings" : { "Customers" : "Data Source xxx; User ID=a; Password=b;", }}C#文件:public class ConfigManager{ static ConfigManager { var builder = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory())原创 2021-09-05 15:57:28 · 790 阅读 · 0 评论 -
【C#】3个栗子完成BeginInvoke/EndInvoke/AsyncResult/AsyncCallback理解
1)同步方案:利用EndInvoke进行阻塞获得返回值:int DDSync(){ Logger.Debug("1-sync"); System.Threading.Thread.Sleep(9999); Logger.Debug("2-sync"); return 11;}Func<int> action = DDSync;IAsyncResult asyncResult = action.BeginInvoke(null, null);int原创 2021-09-05 14:57:37 · 352 阅读 · 0 评论 -
【C#】两种最常用的Task阻塞方式(async/await和Result/Wait)
async void DDAsync() { Logger.Debug("1-async"); Task<bool> task = Task.Run(() => { Logger.Debug("2-async"); System.Threading.Thread.Sl...原创 2021-08-31 13:51:24 · 3693 阅读 · 0 评论 -
C#版winuser.h定义
public class Winuser{ /* * Scroll Bar Constants */ public const int SB_HORZ = 0; public const int SB_VERT = 1; public const int SB_CTL = 2; public const int SB_BOTH = 3; /* * Scroll Bar Commands */ public const int SB_LINEUP = 0; public .原创 2021-04-04 22:39:10 · 1672 阅读 · 0 评论