![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C#4.0学习笔记
文章平均质量分 75
oheasycg
这个作者很懒,什么都没留下…
展开
-
Visual C# 2010 Recipes A Problem-Solution Approach 代码一 —— Create a Console Application from the Command Line
<br />ConsoleUtils.cs<br />using System;namespace Apress.VisualCSharpRecipes.Chapter01{ public class ConsoleUtils { // A method to display a prompt and read a response from the console. public static string ReadString(stri原创 2010-06-09 22:33:00 · 472 阅读 · 0 评论 -
Visual C# 2010 Recipes A Problem-Solution Approach 代码2 —— Create a Windows-Based Application from the Command Line
<br />Recipe01-02.cs<br /> <br />using System;using System.Windows.Forms;namespace Apress.VisualCSharpRecipes.Chapter01{ class Recipe01_02 : Form { // Private members to hold references to the form's controls. private La原创 2010-06-09 22:44:00 · 536 阅读 · 0 评论 -
将dll注册到GAC的简单图解教程
<br /> 前两天读《Visual C# 2010 Recipes A Problem-Solution Approach》一书,发现里面讲到了强命名程序集,等等概念,觉得书上的例子有点繁琐,且不能说明什么问题,所以今天就自己试着写一个简单点的例子,大家先看看。先简单解释一下什么是GAC。注意GAC可不是GC(垃圾回收)。GAC全称是Global Assembly Cache(全局程序集缓存),作用是可以存放一些有很多程序都要用到的公共Assembly,例如System.Data、System.Windo原创 2010-06-10 23:48:00 · 4430 阅读 · 0 评论 -
Visual C# 2010 Recipes A Problem-Solution Approach 代码3—— 创建匿名类型
<br />using System;namespace Apress.VisualCSharpRecipes.Chapter01{ public class Recipe01_18 { static void Main(string[] args) { // create an anoymous type var joe = new {原创 2010-06-14 22:36:00 · 447 阅读 · 0 评论 -
Visual C# 2010 Recipes A Problem-Solution Approach 代码4——创建ExpandoObject Dynamic Type
<br />此代码具有明显的动态语言风格,可以在此感叹一下C#4.0在动态语言特性上的巨大增强<br />using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Dynamic;namespace Apress.VisualCSharpRecipes.Chapter01{ public class Recipe01_19 {原创 2010-06-14 22:43:00 · 424 阅读 · 0 评论 -
Visual C# 2010 Recipes A Problem-Solution Approach 代码7——定义转换运算符
<br />能够把字符串转换为Word类型,同时能够把Word类型转换为int类型<br />using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Dynamic;namespace Apress.VisualCSharpRecipes.Chapter01{ public class Word { publi原创 2010-06-15 21:50:00 · 384 阅读 · 0 评论 -
Visual C# 2010 Recipes A Problem-Solution Approach 代码4——自动完成属性
<br />项目开发中的属性编写一般交给工具,所以这项改进大约是想节省一下程序员的眼力,少显示几个字符<br /> <br />using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Dynamic;namespace Apress.VisualCSharpRecipes.Chapter01{ public class Recipe0原创 2010-06-14 22:48:00 · 444 阅读 · 0 评论 -
Visual C# 2010 Recipes A Problem-Solution Approach 代码6——运算符重载
此案例重载了运算符“+”,将自定义Word类型与int类型连接在一起生成一个字符串using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Dynamic;namespace Apress.VisualCSharpRecipes.Chapter01{ public class Word { public stri原创 2010-06-15 21:18:00 · 412 阅读 · 0 评论