随笔分类 -  C#

把URL传递参数转变成自定义实体方法
摘要:先定义下要获取的实体: public class InputClass { public long Id { get; set; } public int Status { get; set; } public DateTime UdpateTime... 阅读全文

posted @ 2015-05-28 22:40 Karson007 阅读(993) 评论(0) 推荐(0)

【转载】C#后台声明式验证,远离if验证
摘要:ViewModel public class ViewModel { [Required(ErrorMessage="标题不能为空")] public string Title { get; set; } public string Name { ge... 阅读全文

posted @ 2015-05-26 22:12 Karson007 阅读(184) 评论(0) 推荐(0)

N个数随机相加得出固定值的排列组合
摘要:static double[] iArr = new double[10] { 1,2,3,4,5,6,7,8,9,10 }; static Stack stack = new Stack(); static double tempNum = 0; ... 阅读全文

posted @ 2015-01-15 16:39 Karson007 阅读(937) 评论(0) 推荐(0)

一道算法题
摘要:给出几种产品组合,求出产品最大优惠值protected void Button1_Click(object sender, EventArgs e) { string str_input = TextBox1.Text; List<Product> list_Rule = new List<Product>(); //规则 list_Rule.Add(new Product("A", 1)); list_Rule.Add(new Product("B", 1)); list_Rule.Add(new Pr... 阅读全文

posted @ 2013-05-04 21:18 Karson007 阅读(128) 评论(0) 推荐(0)

ChineseCalender类
摘要:using System;using System.Collections.Generic;using System.Text;namespace ChineseCalender{ #region ChineseCalendarException /// <summary> /// 中国日历异常处理 /// </summary> public class ChineseCalendarException : System.Exception { public ChineseCalendarException(string msg) ... 阅读全文

posted @ 2013-05-02 12:36 Karson007 阅读(322) 评论(0) 推荐(0)