随笔分类 -  C# Language

C# Language
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->using System; using System.Runtime.InteropServices; class Example { // Use DllImport to import th... 阅读全文
posted @ 2008-09-11 16:58 Athrun 阅读(524) 评论(0) 推荐(0)
摘要:Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/* * Created by SharpDevelop. * User: Administrator * Date: 2008/9/11 * Time: 下午 03:51 * *... 阅读全文
posted @ 2008-09-11 16:53 Athrun 阅读(373) 评论(0) 推荐(0)
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/* * Created by SharpDevelop. * User: Administrator * Date: 2008/9/11 * Time: 下午 02:36 * */ usi... 阅读全文
posted @ 2008-09-11 14:58 Athrun 阅读(578) 评论(0) 推荐(0)
摘要:this 關鍵字所指的是類別 (Class) 的目前執行個體 (Instance),而且也用來當做擴充方法之第一個參數的修飾詞 (Modifier)。 以下為 this 的常見用法: this關鍵字使用的地方: 1,索引 2,this簡單的說,表示所在類.準確的說是代表類的對像. 3,其他場合.代表構造函數 Code highlighting produced by Actipro C... 阅读全文
posted @ 2008-09-05 14:56 Athrun 阅读(595) 评论(0) 推荐(0)
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/*結構體(struct) *通常我們會用來封裝小型相關變量 *例如,點的x,y的坐標. * public struct Point * { * public int X; * ... 阅读全文
posted @ 2008-09-05 14:30 Athrun 阅读(1752) 评论(0) 推荐(0)
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/*枚舉 * 當你想讓一組數字代表特定的意義,並且希望是安全的,可讀性強. * * 枚舉類型是以"自己的方式使用整型" * 枚舉類型可以是:byte,sbyte,short,ushort,int... 阅读全文
posted @ 2008-09-05 14:15 Athrun 阅读(852) 评论(0) 推荐(0)
摘要:snk文件在.net里面被用作存放密钥或密钥对的存储文件,生成密钥对snk文件可以用.net中的sn.exe命令,如“sn -k keyPair.snk”。 snk本身只是用来存放非对称密钥的,但在各个需要用到加密、签名的地方都可以使用: 用snk文件生成强命名程序集,这样一个assembly才可以被赋予full-trust属性,也可以被添加到GAC中。在... 阅读全文
posted @ 2008-09-05 12:31 Athrun 阅读(1634) 评论(0) 推荐(0)
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->using System; class Test { static void Main() { /* try { ... 阅读全文
posted @ 2008-09-04 19:23 Athrun 阅读(461) 评论(0) 推荐(0)
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/* * Created by SharpDevelop. * User: Administrator * Date: 2008/9/4 * Time: 上午 10:40 * 泛型(gerer... 阅读全文
posted @ 2008-09-04 11:13 Athrun 阅读(383) 评论(0) 推荐(0)
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/* * Created by SharpDevelop. * User: Administrator * Date: 2008/9/4 * Time: 上午 12:10 * *... 阅读全文
posted @ 2008-09-04 09:53 Athrun 阅读(469) 评论(0) 推荐(0)
摘要:C# 2.0引入了很多语言扩展,最重要的就是泛型(Generics)、匿名方法(Anonymous Methods)、迭代器(Iterators)和不完全类型(Partial Types)。 ● 泛型允许类、结构、接口、委托和方法通过它们所存贮和操作的数据的类型来参数化。泛型是很有用的,因为它提供了更为强大的编译期间类型检查,需要更少的数据类型之间的显式转换,并且减少了对装箱操作的... 阅读全文
posted @ 2008-09-04 08:47 Athrun 阅读(265) 评论(0) 推荐(0)
摘要:在发布Visual Studio 2005和C#2.0之后,微软公司又马不停蹄的展示了人们所期望的C#的下一代版本:C# 3.0。尽管C# 3.0并没有标准化,微软还是在PDC(专业程序员会议)发布了一个预览版本,因此心急的程序员可以看到一些所期望的特性,这也是本文所讨论的主要内容: ?隐式类型本地变量 ?匿名变量 ?扩展方法 ?对象和Collection初始化符 ?Lambd... 阅读全文
posted @ 2008-09-04 08:34 Athrun 阅读(244) 评论(0) 推荐(0)
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> /* * Created by SharpDevelop. * User: Administrator * Date: 2008/9/3 ... 阅读全文
posted @ 2008-09-03 22:53 Athrun 阅读(552) 评论(0) 推荐(0)
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/* * Created by SharpDevelop. * User: Administrator * Date: 2008/9/3 * Time: 下午 04:52 * 接口的應用ICom... 阅读全文
posted @ 2008-09-03 22:13 Athrun 阅读(341) 评论(0) 推荐(0)
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/* * Created by SharpDevelop. * User: Administrator * Date: 2008/9/3 * Time: 下午 01:40 * 接口(interf... 阅读全文
posted @ 2008-09-03 16:50 Athrun 阅读(604) 评论(0) 推荐(0)
摘要:/* * Created by SharpDevelop. * User: Administrator * Date: 2008/9/3 * Time: 上午 11:04 * 抽像類(abstract) * abstract修飾符可以和類,方法,屬性,索引器及事件一起使用. * 在類聲明中使用abstract修飾符以指示某個類只能是其他類的基類. * 標記為抽像或包含在抽像類中的成... 阅读全文
posted @ 2008-09-03 12:24 Athrun 阅读(739) 评论(0) 推荐(0)
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/* * Created by SharpDevelop. * User: Administrator * Date: 2008/9/3 * Time: 上午 10:20 * 虛方法(virtu... 阅读全文
posted @ 2008-09-03 11:02 Athrun 阅读(465) 评论(0) 推荐(0)
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/* * Created by SharpDevelop. * User: Administrator * Date: 2008/9/2 * Time: 下午 11:39 * 事件(event)... 阅读全文
posted @ 2008-09-03 10:19 Athrun 阅读(1227) 评论(0) 推荐(0)
摘要:/* * Created by SharpDevelop. * User: Administrator * Date: 2008/9/2 * Time: 下午 10:23 * 委托(delegate) 委托聲明定義了一种類型,它用一組特定的參數以及返回類型來封裝方法. 對於靜態方法,委托對像封裝要調用的方法. 對於實例方法,委托對像同時封裝一個實例和該實例上的一個方法. 如果您有一個委托... 阅读全文
posted @ 2008-09-02 23:37 Athrun 阅读(729) 评论(0) 推荐(0)
摘要:轉自:http://www.cnblogs.com/smile2008/articles/1217567.html class Test { private static string _name; private static string _id; static void Main() { _name=Console.ReadLine();... 阅读全文
posted @ 2008-09-02 00:01 Athrun 阅读(311) 评论(0) 推荐(0)