EasyText, EasyLicense 的作者, https://github.com/EasyHelper Good Good Study,Day Day Up.

 

12 2011 档案

摘要:如果有人问你,C# 中可以new 一个接口吗?,你会怎么回答? 假设ITestInterface 是一个接口,那么这样的代码是否有问题? ITestInterface testInterface = new ITestInterface(); 很多书上都会说,当然有问题,接口不能用new ,然后你就认为上... 阅读全文
posted @ 2011-12-15 06:36 LoveJenny 阅读(8193) 评论(45) 推荐(35) 编辑
摘要:新建控制台程序CAStudy.在应用程序中,添加books.xml,belowAvg.xsl 代码分别如下: books.xml <?xml version='1.0'?> <!-- This file represents a fragment of a book store inventory database --> <bookstore> <book genre="autobiography" publicationdate="1981" ISBN="1-861003-11-0& 阅读全文
posted @ 2011-12-13 06:46 LoveJenny 阅读(3857) 评论(4) 推荐(3) 编辑
摘要:假设有一个string “BaSiC”,需要将它转变为大小写,那么该如何转换? 最简单的方式:调用api: string str = "BaSiC"; string strUpper = str.ToUpper(); string strLower = str.ToLower(); 第二种方法:调用Char.ToUpper(),Char.ToLower()方法,同样是调用api 第三种方法:使用for循环来判断,如果是大写就,如... 阅读全文
posted @ 2011-12-09 06:35 LoveJenny 阅读(3338) 评论(24) 推荐(10) 编辑
摘要:首先说明:如果没有进入调试模式的话,默认的调试窗口如下: 开始前的准备: 新建控制台程序DebugWindowDemo: 修改Program.cs 的代码为: program.csusing System;using System.Threading;using System.Threading.Tasks;using System.Diagnostics;class S { public static void Main() { pcount = Environment.ProcessorCount; Co... 阅读全文
posted @ 2011-12-08 06:43 LoveJenny 阅读(2569) 评论(8) 推荐(11) 编辑
摘要:以实例说话,一起体验MEF带来的可扩展性吧,Let’s Rock!!! 1:新建控制台程序SimpleCalculator 在这里要实现的程序时SimpleCalculator,顾名思义:简单的计算器。 所以我们需要定义一个用来计算的接口: public interface ICalculator { String Calculate(String input); } Program 的代码如下: class Program { private CompositionCo... 阅读全文
posted @ 2011-12-07 06:46 LoveJenny 阅读(10471) 评论(12) 推荐(31) 编辑
摘要:命名空间别名: 如果你的类的名称恰巧和别人一样,但是两个类的命名空间不一样,那么该如何处理呢? namespace CompanyA.AssemblyA { public class Console { public static void DoA() { //just do nothing } } } namespace CompanyB.AssemblyB { public ... 阅读全文
posted @ 2011-12-05 06:36 LoveJenny 阅读(1740) 评论(4) 推荐(5) 编辑
摘要:在Ftp上传上,有人上传了高清图片,每张图片大约2M。 如果使用传统的BitmapImage类,然后绑定 Source 属性的方法,有些电脑在首次会比较卡,一张电脑10秒,4张大约会卡40秒。 所以我先异步的下载图片,得到downloadFileStream对象,然后绑定到BitmapImage类上。例如: System.Windows.Controls.Image photo = new Image { Width = 100, Height = 100, ... 阅读全文
posted @ 2011-12-02 06:36 LoveJenny 阅读(4345) 评论(3) 推荐(6) 编辑

EasyText, EasyLicense 的作者, https://github.com/EasyHelper Good Good Study,Day Day Up.

 

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