随笔分类 -  C#

1
摘要:"Serilog": { "MinimumLevel": { "Default": "Information", "Override": { "Microsoft": "Warning", "System": "Warning" } }, "Enrich": [ "FromLogContext", 阅读全文
posted @ 2021-07-04 15:46 Researcher 阅读(478) 评论(0) 推荐(0)
摘要:using Newtonsoft.Json;using Newtonsoft.Json.Converters;using Newtonsoft.Json.Serialization;using System;using System.Collections.Generic;using System. 阅读全文
posted @ 2021-07-04 15:35 Researcher 阅读(80) 评论(0) 推荐(0)
摘要:System.Runtime.Serialization.SerializationException: Type is not resolved for member 'Oracle.ManagedDataAccess.Client.OracleException,Oracle.ManagedDa 阅读全文
posted @ 2018-02-26 17:00 Researcher 阅读(375) 评论(0) 推荐(0)
摘要:Referenced: http://jingyan.baidu.com/article/7908e85ca6db2daf491ad27e.html 1. Install IIS on IIS server, make sure the Web Management Service is start 阅读全文
posted @ 2017-08-24 18:26 Researcher 阅读(247) 评论(0) 推荐(0)
摘要:EF有什么缺点,什么时候需要考虑用ADO.NET http://blog.sina.com.cn/s/blog_4aedf6370102wgxl.html 阅读全文
posted @ 2017-02-21 16:26 Researcher 阅读(215) 评论(0) 推荐(0)
摘要:面试官说貌似都是Code First了,需确认下 阅读全文
posted @ 2017-02-21 15:53 Researcher 阅读(95) 评论(0) 推荐(0)
摘要:详细描述它们之间的区别,为什么这么选择,尤其是WCF vs WebAPI 阅读全文
posted @ 2017-02-21 15:51 Researcher 阅读(599) 评论(0) 推荐(0)
摘要:为了防止数据被错误修改例如商品库存被改为-1如何加锁,应该加什么锁,相应的机制是什么 阅读全文
posted @ 2017-02-21 15:46 Researcher 阅读(199) 评论(0) 推荐(0)
摘要:Action和Fuc的区别,参数和具体用法 阅读全文
posted @ 2017-02-21 15:41 Researcher 阅读(333) 评论(0) 推荐(0)
摘要:https://zh.wikipedia.org/wiki/Redis http://www.jianshu.com/p/01b37cdb3f33 阅读全文
posted @ 2016-10-21 10:47 Researcher 阅读(801) 评论(0) 推荐(0)
摘要:When would I use Task.Yield()? http://stackoverflow.com/questions/22645024/when-would-i-use-task-yield In order to have a better understanding for abo 阅读全文
posted @ 2016-09-29 12:49 Researcher 阅读(81) 评论(0) 推荐(0)
摘要:Issue: HttpClient.GetAsync(…) never returns when using await/async Related Posts: http://stackoverflow.com/questions/9895048/async-call-with-await-in- 阅读全文
posted @ 2016-09-29 11:11 Researcher 阅读(139) 评论(0) 推荐(0)
摘要:这两天写程序发现,多线程同时读写一个配置文件,会抛异常导致失败,看来必须加锁才行,但是这样性能又会受损失,但这是没办法的事,最后的解决方案是,把多线程产生的结果先保存在一个ConcurrentDictionary中,然后再用单线程写入配置文件,这样速度避免了对文件写操作的竞争,用单线程反而非常的快!... 阅读全文
posted @ 2015-11-30 20:34 Researcher 阅读(142) 评论(0) 推荐(0)
摘要:static string GetLotteryByPhase(string phaseNo) { // Set the url and charset string url = "http://baidu.lecai.com... 阅读全文
posted @ 2015-11-29 17:26 Researcher 阅读(222) 评论(0) 推荐(0)
摘要:List taskList = new List(); // string currentNoStr = null; cannot define at here, we should define the copy in for loop, this i... 阅读全文
posted @ 2015-11-29 17:12 Researcher 阅读(136) 评论(0) 推荐(0)
摘要:// Sort dictionary by the value field List> redBallsList = redBallsDict.ToList(); List> blueBallsList = blueBallsDic... 阅读全文
posted @ 2015-11-29 16:56 Researcher 阅读(152) 评论(0) 推荐(0)
摘要:下面是如何最大化console和改变其显示的字体颜色的代码,顺便包含了计时代码(帮助做性能分析): class Program { [DllImport("kernel32.dll", ExactSpelling = true)] private static... 阅读全文
posted @ 2015-11-29 16:50 Researcher 阅读(129) 评论(0) 推荐(0)
摘要:1. Write native(unmanaged) code with C/C++, and make sure compile it as a DLL, the sample is as below#include using namespace std;extern "C"{ _decls... 阅读全文
posted @ 2015-11-23 23:30 Researcher 阅读(235) 评论(0) 推荐(0)
摘要:1.FileStream.Writestring filePath = Directory.GetCurrentDirectory() + "\\" + Process.GetCurrentProcess().ProcessName + ".txt"; if (File.Exi... 阅读全文
posted @ 2015-11-23 19:25 Researcher 阅读(85778) 评论(0) 推荐(0)
摘要:第一种,手工移动。该方法根据鼠标位置实现窗体的移动。网上有很多相关的例子,这里不再多讲。第二种,调用系统API原理:是当鼠标左键按下时,让系统认为是在标题栏按下的。这里我们用到了winapi里的WM_LBUTTONDOWN(客户区鼠标左键按下,值:0x0201)和WM_NCLBUTTONDOWN(非... 阅读全文
posted @ 2015-11-23 18:28 Researcher 阅读(2758) 评论(1) 推荐(0)

1