随笔分类 -  C#

摘要:11.3 转换到目前为止,在需要把一种类型转换为另一种类型时,使用的都是类型转换。而这并不是唯一的方式。在计算过程中,int可以采用相同的方式隐式转换为long或double,还可以定义所创建的类(隐式或显式)转换为其他类的方式。为此,可以重载转换运算符,其方式与本章前面重载其他运算符的方式相同。1... 阅读全文
posted @ 2015-04-11 19:30 ChuckLu 阅读(506) 评论(0) 推荐(0) 编辑
摘要:运算符重载看起来与标准静态方法声明类似,但它们使用关键字operator和运算符本身,而不是一个方法名:public static 返回类型 operator +(类型1 变量1,类型2 变量2){ //返回类型,类型1,类型2 ,可以相同,也可以全部不同}如果使用混合类型的话,需要注意的是,不... 阅读全文
posted @ 2015-04-07 17:45 ChuckLu 阅读(550) 评论(0) 推荐(0) 编辑
摘要:http://www.codeproject.com/Articles/193537/C-4-Tuples 阅读全文
posted @ 2015-04-01 13:35 ChuckLu 阅读(262) 评论(0) 推荐(0) 编辑
摘要:https://github.com/dodev/RoadDataCollector A tool for collecting information from sensor devices.core - dodevgui - dotmeerlocaldb - naitharremotedb - ... 阅读全文
posted @ 2015-03-06 15:37 ChuckLu 阅读(1027) 评论(0) 推荐(0) 编辑
摘要:在命名空间System.Collections下的CollectionBase类The CollectionBase class exposes the interfaces IEnumerable , ICollection , and IList but onlyCollectionBase 类... 阅读全文
posted @ 2015-03-03 20:06 ChuckLu 阅读(551) 评论(0) 推荐(0) 编辑
摘要:方法一:LinqChannelList就是一个List类型的数据,IsOpen 是其元素的属性channelCount = (from channel in DevicesManager.Instance.CurrentDevice.ChannelList ... 阅读全文
posted @ 2015-02-03 11:29 ChuckLu 阅读(15783) 评论(0) 推荐(0) 编辑
摘要:有类A,以及A类型的变量a和b。初始化a之后,将a赋给b。之后将a赋为null。之后b还是可以使用。 思维误区:本来以为a=null之后,b也应该等于null。 实际测试效果如下 最后在stackoverflow上找到了答案,原来对一个引用赋null,仅仅是把指向去掉了。其他变量还是可以指向之前的内 阅读全文
posted @ 2015-01-12 10:15 ChuckLu 阅读(5542) 评论(0) 推荐(1) 编辑
摘要:http://cnn237111.blog.51cto.com/2359144/1343004 GC.Collect如何影响垃圾回收主要是//GC.Collect();//GC.WaitForPendingFinalizers();http://q.cnblogs.com/q/35019/ C# ... 阅读全文
posted @ 2015-01-12 09:59 ChuckLu 阅读(464) 评论(0) 推荐(0) 编辑
摘要:下面的代码,会发现事件没有被注册 class Program { static void Main(string[] args) { EventCheck check = new EventCheck(); check.O... 阅读全文
posted @ 2015-01-12 09:16 ChuckLu 阅读(929) 评论(2) 推荐(0) 编辑
摘要:Handling and Raising Events包括函数名的写法 https://msdn.microsoft.com/en-us/library/edzehd2t.aspx 观察者设计模式 注意查看相关主题的资料 http://msdn.microsoft.com/en-us/library 阅读全文
posted @ 2015-01-09 22:00 ChuckLu 阅读(240) 评论(0) 推荐(0) 编辑
摘要:本来是知道x86和x64的区别的。今天突然在VS2008上看到一个win32的选项,一下子懵了,这是什么玩意。百度之,发现[答案](http://zhidao.baidu.com/link?url=ENKnJOAOyONuOBLiaEqZPD38cmuD4uPatIDy9cfwEEctWKZnizp... 阅读全文
posted @ 2015-01-03 15:05 ChuckLu 阅读(17921) 评论(0) 推荐(2) 编辑
摘要:http://stackoverflow.com/questions/1113819/arrays-heap-and-stack-and-value-typesYour array is allocated on the heap, and the ints are not boxed.The so... 阅读全文
posted @ 2014-12-15 20:38 ChuckLu 阅读(222) 评论(0) 推荐(0) 编辑
摘要:http://msdn.microsoft.com/en-us/library/ms171878.aspx 1.首先创建一张表 2.保存一个xml文件schema.xml 3.再保存另外一个xml文件data.xml 4.打开VS,创建一个控制台应用程序 5.添加dll引用 In the COM t 阅读全文
posted @ 2014-11-17 16:37 ChuckLu 阅读(458) 评论(0) 推荐(0) 编辑
摘要:https://en.wikipedia.org/wiki/C_Sharp_(programming_language)#Versions http://stackoverflow.com/questions/247621/what-are-the-correct-version-numbers-f 阅读全文
posted @ 2014-11-09 20:18 ChuckLu 阅读(5035) 评论(2) 推荐(3) 编辑
摘要:False ..\CommonDll\PhySec(x86)\System.Data.SQLite.dll False ..\CommonDll\PhySec(x64)\System.Data.SQLite.dll 系统会自动... 阅读全文
posted @ 2014-10-15 10:09 ChuckLu 阅读(2513) 评论(0) 推荐(0) 编辑
摘要:c#不支持宏定义,只支持编译开关。======================================我想加上#define xxx就编译a代码,否则编译b代码,像这样的:#if xxxa #elseb #endif===================================... 阅读全文
posted @ 2014-08-25 10:43 ChuckLu 阅读(3112) 评论(0) 推荐(0) 编辑
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Globalization;using System.IO;using System.Runtime.Comp... 阅读全文
posted @ 2014-02-19 13:05 ChuckLu 阅读(2309) 评论(0) 推荐(1) 编辑
摘要:甲乙两个人用一个英语单词玩游戏。两个人轮流进行,每个人每次从中删掉任意一个字母,如果剩余的字母序列是严格单调递增的(按字典序a dictionaryStr = new Dictionary(); static void Main(string[] arg... 阅读全文
posted @ 2013-12-26 09:44 ChuckLu 阅读(2361) 评论(0) 推荐(0) 编辑
摘要:匿名方法 Lambda 表达式 C#类反射 http://379910987.blog.163.com/blog/static/33523797201011493015548/ XmlSerializer的使用 http://www.cnblogs.com/zsh_robot/articles/13 阅读全文
posted @ 2012-11-27 09:56 ChuckLu 阅读(334) 评论(0) 推荐(0) 编辑
摘要:参看此链接http://www.cnblogs.com/longwu/archive/2011/08/25/2153636.html在上述代码的基础上进行了修改,包括一些捕获异常以及按钮的应用,扩充了一个listbox确保服务端可以选择和不同的客户端进行通信using System;using Sy... 阅读全文
posted @ 2012-11-23 16:58 ChuckLu 阅读(36089) 评论(11) 推荐(10) 编辑

点击右上角即可分享
微信分享提示