- 博客(7)
- 收藏
- 关注
原创 C#读写config.ini文件
这是操作INI文件的类using System; using System.IO; using System.Runtime.InteropServices; using System.Text; using System.Collections; using System.Collections.Specialized; namespace IniFiles { class Opera...
2018-02-28 14:36:50
894
原创 App.config文件读写
class Program { static void Main(string[] args) { string name = ConfigurationManager.AppSettings["NAME"].ToString(); int age = int.Parse(ConfigurationMana...
2018-02-26 13:37:06
251
原创 C#学习笔记之 策略与简单工厂的结合
CashSuper类是抽象策略,CashNormal,CashRebate,CashReturn为三个具体的策略,策略无需改动,增加CashContext类,修改客户端代码即可namespace 商城收银管理 {//收费策略Context class CashContext { private CashSuper cs;//声明一个现金收费父类对象...
2018-02-26 09:27:51
397
原创 C#学习笔记之 策略模式
namespace 商城收银管理 {//收费策略Context class CashContext { private CashSuper cs; //声明一个现金收费父类对象cs //设置策略行为,参数具体的现金收费子类(正常,打折或返利) public CashContext(CashSuper csuper)//通过策略方法,...
2018-02-25 20:23:17
260
原创 C#学习笔记之 简单工厂模式2
商场促销模式//现金收费抽象类 namespace 商城收银管理 { abstract class CashSuper { //抽象方法:收取现金,参数为原价,返回为当前价 public abstract double acceptCash(double money); } }//正常收费子类 namespace 商城收银管理 { c...
2018-02-25 16:24:41
283
原创 C#学习笔记之 简单工厂模式
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Calculator { class Program { static void Main(string[] ar...
2018-02-24 11:33:45
261
原创 C#学习笔记之 类的封装
类的封装封装运算方法这个类,后面多个程序可调用相同的类using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Calculator { class Program//客户端代码 { ...
2018-02-24 10:45:12
835
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅