程序员思想

专注互联网技术分享,以及码代码之外的成长话题。

随笔分类 -  .Net基础

.Net基础
摘要:1 基本概念 HTTP协议:基于TCP协议之上实现的无状态、全文本的标准通信协议。 客户端:例如pc浏览器,移动应用端,第三方服务器等能发起http访问的设备。 服务器:能够接受HTTP协议请求,并且通常能够正常返回响应结果给客户端的设备。 HTTP协议其实说起来很简单,它有两个重要特性:纯文本,无 阅读全文
posted @ 2020-12-10 20:35 12饕餮21 阅读(713) 评论(0) 推荐(1)
摘要:public class WaitQueue : IDisposable where T : class { /// /// The deal action. /// public Action DealAction { get; set; } /// /// The inner queue. /// private readonly ConcurrentQueue _innerQueue; /// /// The deal thread. /// private readonly Thread dealThread; /// /// The flag f 阅读全文
posted @ 2016-01-16 11:08 12饕餮21 阅读(336) 评论(1) 推荐(0)
摘要:esp是栈指针,是cpu机制决定的,push、pop指令会自动调整esp的值; ebp只是存取某时刻的esp,这个时刻就是进入一个函数内后,cpu会将esp的值赋给ebp,此时就可以通过ebp对栈进行操作,比如获取函数参数,局部变量等,实际上使用esp也可以; 既然使用esp也可以,那么为什么要设定ebp呢? 答案是为了方便程序员。 阅读全文
posted @ 2015-06-28 19:07 12饕餮21 阅读(1766) 评论(0) 推荐(0)
摘要:之前在实现Autofac扫描自加载程序集实现IOC时候遇到程序集依赖的问题,在网上搜了一下,没有发现中文世界的相关描述。随取google拿了几篇文章,翻译&自己的理解,之后会写一些小demo,如下: 阅读全文
posted @ 2015-05-05 11:09 12饕餮21 阅读(1184) 评论(2) 推荐(9)
摘要:以前一直都以为.Net编译器会吧默认参数编译成重载的模式以供主调DLL调用,直到最近想扩展一个方法还不想影响以前的调用,于是就添加了默认参数。谁知道把方法所在DLL编译发布以后发现程序直接抛出找不到Method的异常了,之后我把主调用的dll编译了一下之后发现又能用了,这是什么鬼? 写一个Demo验证一下: 阅读全文
posted @ 2015-03-29 14:34 12饕餮21 阅读(1251) 评论(10) 推荐(6)
摘要:知道linq有order by的功能,但是还是动手研究了一下,算是多实践实践反射。这篇算是笔记,直接上代码: 阅读全文
posted @ 2015-03-15 21:33 12饕餮21 阅读(505) 评论(1) 推荐(1)
摘要:结合IL的结果和C对象的方法表的Dump结果,相信看官已经明白为啥两次调用为啥会用不同了吧。 算了,还是简单描述一下吧:首先根据il的结果明显两次调用请求的方法是不同的;其次,你可以看到我们的C对象引用的方法表里面确实有两个Foo方法。 呵呵,这样同样类型的对象对不同方法调用的请求是不是就可以分开了呢?当然是! 阅读全文
posted @ 2015-02-17 18:35 12饕餮21 阅读(1092) 评论(0) 推荐(2)
摘要:首先看到的是这是一个internal的类,怪不得没见有人这么写过呢! 研究一番之后,终于弄清楚这货是干嘛的了:这个类的作用就是缓存一个StringBuilder对象,给那些并不是要做很多Append操作的地方使用的,我们也看到private const int MAX_BUILDER_SIZE = 360,它内部用来判断是用缓存的StringBuilder函数新new出来一个的界限阀值是360. 阅读全文
posted @ 2015-02-08 23:23 12饕餮21 阅读(3587) 评论(9) 推荐(18)
摘要:禁止Asp.Net WebService 的Test页面功能 阅读全文
posted @ 2015-01-20 21:52 12饕餮21 阅读(410) 评论(0) 推荐(0)
摘要:我们经常会遇到这样的场景: 今天来了个业务,需要加一个字段,但是考虑的以后可能有变动,需要配成“活”的。 一般最初的做法就是加一个配置到Web.Config文件的AppSettings中去。但是这样有一个问题,那就是改一下配置节点,AppDomain就需要重启,很是不爽。 变通一点的会搞出一个xml文件,利用序列化去动态的读取。但是,哥!每次都读文件不觉得太耗IO吗?尤其是使用频率高话? 阅读全文
posted @ 2015-01-17 22:42 12饕餮21 阅读(1088) 评论(1) 推荐(0)
摘要:今天又一次郁闷了,看Orchard真实学到不少东西哇! Web.Config里面appSettings节点原来可以直接引用一个文件,以前还老想着微软真二,配置节点多了肿么办? 阅读全文
posted @ 2015-01-14 19:28 12饕餮21 阅读(804) 评论(2) 推荐(1)
摘要:下面的示例说明如何指定运行库应在其中搜索程序集的应用程序基子目录。 阅读全文
posted @ 2015-01-14 13:08 12饕餮21 阅读(244) 评论(0) 推荐(0)
摘要:和.net内存调试相关的Windbg命令 首先.load sosex.dll加载ex调试扩展dll 阅读全文
posted @ 2014-11-02 20:20 12饕餮21 阅读(511) 评论(0) 推荐(0)
摘要:You'd have thought that memory leaks were a thing of the past now that we use .NET. True, but we can still hit problems. We can, for example, prevent memory from being recycled if we inadvertently hold references to objects that we are no longer using. However, there is another serious memory problem in .NET that can happen out of the blue, especially if you are using large object arrays. Andrew Hunter explains... Usually, .NET developers don’t need to think too much about how their objects a 阅读全文
posted @ 2014-10-29 15:49 12饕餮21 阅读(336) 评论(0) 推荐(0)
摘要:Advanced .NET Debugging: Managed Heap and Garbage Collection(转载,托管堆查内存碎片问题解决思路) 阅读全文
posted @ 2014-10-28 22:56 12饕餮21 阅读(308) 评论(0) 推荐(0)
摘要:应用程序调试,需要有个常规的调试思路,应对各类问题最基本的调试手段是什么,不能一头雾水的上手而乱了阵脚,而且根据经验统计这些基本的步骤可以解决大多数的问题。 阅读全文
posted @ 2014-10-27 02:08 12饕餮21 阅读(483) 评论(0) 推荐(1)
摘要:Investigating issues with Unmanaged Memory. First steps. 阅读全文
posted @ 2014-10-25 08:56 12饕餮21 阅读(296) 评论(0) 推荐(0)
摘要:原文地址:http://blogs.msdn.com/b/tess/archive/2006/02/15/532804.aspx I hate to give away the resolution in the title of the blog since it takes away a lot of the suspense:) but I can't figure out a better way to name the blog posts and still keep them nicely searcheable so here we go... 阅读全文
posted @ 2014-10-24 23:05 12饕餮21 阅读(872) 评论(0) 推荐(0)
摘要:/// /// 最简单的加法表达式树 /// /// 根节点 /// BanaryExpression /// NodeType = Add /// Type=System.Int32 /// /// 左叶子 右叶子 /// firstArg secondArg /// ConstantExpression ConstantExpression /// NodeType=Constant NodeType=Constant /// 阅读全文
posted @ 2014-09-24 22:11 12饕餮21 阅读(197) 评论(0) 推荐(1)