.NET
文章平均质量分 62
realduke2000
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
C#异步方法调用
计算机中有些处理比较耗时。调用这种处理代码时,调用方如果站在那里苦苦等待,会严重影响程序性能。例如,某个程序启动后如果需要打开文件读出其中的数据,再根据这些数据进行一系列初始化处理,程序主窗口将迟迟不能显示,让用户感到这个程序怎么等半天也不出来,太差劲了。借助异步调用可以把问题轻松化解:把整个初始化处理放进一个单独线程,主线程启动此线程后接着往下走,让主窗口瞬间显示出来。等用户盯着窗口犯呆时,初始原创 2007-10-26 17:35:00 · 1266 阅读 · 0 评论 -
WCFService and WCFClient
Reading these articles almost the whole night, will try to implement the WCFServcie/WCFClient with credential authenticationCustom原创 2011-09-19 23:48:58 · 503 阅读 · 0 评论 -
Registry key and Registry value
Today I have a implement a method to create/delete a specify registry key, it alwasy throw exception say the registry key does not exist, it原创 2011-08-23 17:11:52 · 1003 阅读 · 0 评论 -
Combine algorithm
Get combines by recursion, low performance.class Program { /// /// Print all combines of C(n)(Left) /原创 2011-10-14 03:08:06 · 1144 阅读 · 0 评论 -
Logical operator
While I'm writing a test case, I found once the logical operator had calculated the result, it wont' execute left statement.It won't affect my test result, but I found I never notice this before.E原创 2011-12-28 15:53:10 · 731 阅读 · 0 评论 -
ThreadStatic attribute
A static field marked with ThreadStaticAttribute is not shared between threads. Each executing thread has a separate instance of the field, and independently sets and gets values for that field. If原创 2012-04-12 15:54:41 · 864 阅读 · 0 评论 -
Why generics in method signatures?
Coming from PHP to C#, this syntax was intimidating:container.RegisterTypeCustomer>("customer1");until I realized it expresses the same thing as:container.RegisterType(typeof(Customer), "cust转载 2012-06-15 14:44:43 · 519 阅读 · 0 评论 -
Uninstall visual studio 2008
While I made a mistake while installing visual studio 2008, it was interrupted. I suppose some of feature/component was not installed correctly, so I decided to re-install it.However, I found there转载 2012-06-25 10:21:12 · 793 阅读 · 0 评论 -
Trouble shooting windows certificate problems.
A simple way to to enable CAPI2 LOG at eventvwr -> applications and services log -> microsoft -> windows -> CAPI2 -> operational.Such like this, I encounter this problem, obviously it's a certifica原创 2012-08-20 13:29:41 · 1993 阅读 · 0 评论 -
Sort using
工作环境的build.exe要求代码的using namespace 必须按字母顺序排列,今天被一直提示编译错误,浪费了我N久来手动排序,崩溃了,就想写一个小东西来排序using。其实以前试过List.Sort(),发现结果并不准确。于是今天晚上抽空自己写了一个,写完了才发现,原来之前一直都忘记trim掉using xxxx;最后面那个分号,所以才导致结果不可靠,郁闷ing。不过写原创 2012-10-23 22:52:35 · 578 阅读 · 0 评论 -
The easy way to run Powershell 2.0 using .NET Framework 4.0
http://viziblr.com/news/2012/5/16/the-easy-way-to-run-powershell-20-using-net-framework-40.htmlIf you've been exploring creating your own modules and cmdlets with Visual Studio, you've likel转载 2013-02-28 14:44:41 · 777 阅读 · 0 评论 -
What Every Dev Must Know About Multithreaded Apps
http://msdn.microsoft.com/en-us/magazine/cc163744.aspxVance MorrisonThis article discusses:Multithreading and the shared memory threading modelRaces and how concurrent access can原创 2011-06-08 16:05:00 · 889 阅读 · 0 评论 -
XmlTextReader and XmlException: Root element is missing
<br />http://edwardweinert.com/programming/xmltextreader-and-xmlexception-root-element-is-missing/<br /> <br /><br />During my work with XML in .NET I ran across strange behavior of passing stream into a XmlTextReader object. When I tried to read a stream原创 2011-05-14 20:44:00 · 2694 阅读 · 0 评论 -
关于.net assembly的strong name问题
<br />按照我当前的理解,.net assembly作为com的接班人,需要解决dll的版本问题。<br /> <br />错误一般发生在运行时,会抛出IO Exception,指明strong name name validation failed.<br /> <br />很多时候,这说明你当前程序引用的assembly是strong name的,需要用gacutil进行注册(就像regsvr32注册com组件一样)<br /> <br />详细用法参见gacutil /?<br /> <br />原创 2010-11-17 14:16:00 · 1272 阅读 · 0 评论 -
一份RSA的源码(C#)
Using directives#region Using directives using System; using System.Collections.Generic; using System.Text; using System.Diagnostics; #endregion namespace rsatest ...{ /**//* RSA算法 1978原创 2008-02-26 11:09:00 · 2228 阅读 · 1 评论 -
接口和继承的区别
当使用继承的时候,主要是为了不必重新开发,并且在不必了解实现细节的情况下拥有了父类我所需要的特征。 但是很多时候,一个子类并不需要父类的所有特征,它可能只是需要其中的某些特征,但是由于通过继承,父类所有的特征都有了,需要的和不需要的特征同时具备了。而那些子类实际上不需要用到的,有时候甚至是极力避免使用的特征也可以随便使用,这就是继承的副作用。特别是允许多重继承的OO语言中,很容易引起不容易发现的错原创 2008-03-11 12:17:00 · 5988 阅读 · 2 评论 -
串口收发即时显示的效率问题
最近一直在做串口的程序,发现用。net写的串口即时显示程序竟然效率非常低,而且经常会丢数据。排出了语言本身效率的问题(白痴,你这种程序的效率如果微软都达不到,还干个屁了阿),发现每次读取数据的多少影响效率,再进而发现其实最影响效率的其实是界面的刷新!以前总是读到数据就马上刷新界面,这样是很影响速度的!于是改进做法,每次读取一定量的数据后再显示,只要人眼分辨不出来就好了!结果,效率有大幅度的提高原创 2007-12-25 15:47:00 · 1093 阅读 · 0 评论 -
关于C#静态构造方法的几点说明
静态构造函数是C#的一个新特性,其实好像很少用到。不过当我们想初始化一些静态变量的时候就需要用到它了。这个构造函数是属于类的,而不是属于哪里实例的,就是说这个构造函数只会被执行一次。也就是在创建第一个实例或引用任何静态成员之前,由.NET自动调用。 class SimpleClass { // Static constructor static SimpleClass() { // } }原创 2008-01-09 14:55:00 · 3682 阅读 · 3 评论 -
时间格式问题
System.Globalization.CultureInfo.InvariantCulture : 和操作系统的语言无关!也就是说,其他的表示方式在不同的操作系统中得的结果可能不一样! public String dtToString() { DateTime dt = DateTime.Now; String []s=new原创 2008-04-21 09:48:00 · 571 阅读 · 0 评论 -
Globalization更加详细的介绍
System.Globalization 命名空间包含定义区域性相关信息的类,这些信息包括语言、国家/地区、使用的日历、日期、货币和数字的格式模式以及字符串的排序顺序。我们可以使用这些类编写全球化(国际化)应用程序。而像 StringInfo 和 TextInfo 这样的类更是为我们提供了诸如代理项支持和文本元素处理等高级全球化功能。类原创 2008-04-21 09:55:00 · 2012 阅读 · 0 评论 -
用反射来解决字段多带来的烦恼(转自论坛)
做项目开发的时候,大家应该经常都会遇到一个表里面的很多个字段的情况吧.在之前我接触的一个项目,有一个表有20多个字段.要向表中添加记录,和将一条数据绑定到页面上都要写很多代码.如: 下面是一个用户表的添加 User user = new User(); user.Name = this.txt_Name.Text; user.Remark = th原创 2008-04-29 23:51:00 · 769 阅读 · 1 评论 -
如何寻找已注册dll的路径
在HKEY_LOCAL_MACHINE/SOFTWARE/MICROSOFT/WINDOWS/CURRENTVERSION/ShareedDlls 中存放所有注册过的dll的属性,其中VALUE NAME 为该dll的路径,value data表明当前有几个进程在访问、使用这个dll。所以可以在程序中顺序访问该文件夹下的所有dll找到你需要的,提取出它的路径。原创 2008-07-16 17:06:00 · 4876 阅读 · 0 评论 -
C#面向对象分析
2008-05-13 来源:网络原创 2008-05-18 21:16:00 · 797 阅读 · 0 评论 -
RegexOptions 枚举
RegexOptions 枚举 提供用于设置正则表达式选项的枚举值。 此枚举具有允许按位组合其成员值的 FlagsAttribute 属性。 [Visual Basic]转载 2008-07-03 13:19:00 · 778 阅读 · 0 评论 -
How to debug .net framework
<br />reference:<br /> <br />http://blogs.msdn.com/b/sburke/archive/2008/01/16/configuring-visual-studio-to-debug-net-framework-source-code.aspx<br /> <br />Configuring Visual Studio to Debug .NET Framework Source Code<br /> <br /><br />It's finally here -原创 2010-12-28 13:29:00 · 1096 阅读 · 0 评论 -
Overloading Methods in WCF
http://jeffbarnes.net/blog/post/2006/09/21/overloading-methods-in-wcf.aspxYesterday, I attended a local MSDN event in the Birmingham area. It covered the .NET 2.0 System.Net namespace, an i转载 2013-10-30 14:14:53 · 619 阅读 · 0 评论
分享