随笔分类 -  C#

C#
摘要:1 2 --通过行更新的方法实现按行累计(可分类目累计) 3 --created by 倪斌斌 4 --datetime 2020-03-20 5 6 7 --SID 累加的排序字段(原表的数据可以是无序的) 8 --ItemId 累加的类目,如果没有类目字段,就是整表按顺序累计 9 --SCORE 阅读全文
posted @ 2020-03-20 09:35 niky 阅读(210) 评论(0) 推荐(0)
摘要:使用公式℃=(5/9)(°F-32)打印下列华氏温度与摄氏温度对照表: 0 -17.820 -6.740 4.460 15.680 26.7100 37.8120 48.9140 60.0160 71.1180 82.2200 93.3220 104.4240 115.6260 126.7280 137.8300 148.9代码如下:要点整理:1、结果集中我们可以看到有1位小数,因此输出中要制定小数的位数,即%6.1f;2、公式中的(5/9)是不能直接照办斤程序中的,因为整数除法会进行舍位,结果将永远是0,因此需要用浮点数,即5.0/9.0 ,而*后面的(fahr-32)虽然也是整型 阅读全文
posted @ 2013-04-16 14:41 niky 阅读(1691) 评论(0) 推荐(0)
摘要:最近的客户对系统提出了新的单据编号的编码规则,当前我们的编号编码规则显然已经不能满足客户需求,于是就有了以下的粗略设计,等需求设计确定后我会再将具体的设计细节贴上,也欢迎大家拍砖! 阅读全文
posted @ 2012-10-10 09:54 niky 阅读(386) 评论(0) 推荐(0)
摘要:Some Useful ExamplesString.Format("{0:$#,##0.00;($#,##0.00);Zero}", value);This will output "$1,240.00" if passed 1243.50. It will output the same format but in parentheses if the number is negative, and will output the string "Zero" if the number is zero.String.Format( 阅读全文
posted @ 2012-09-25 11:19 niky 阅读(200) 评论(0) 推荐(0)
摘要:SharpZipLib 是一个免费的Zip操作类库,可以利用它对 ZIP 等多种格式进行压缩与解压。下载网址:http://www.icsharpcode.net/OpenSource/SharpZipLib/Download.aspx。目前的版本为0.86。1、创建zip文件,并添加文件:using(ZipFilezip=ZipFile.Create(@"E:\test.zip")){zip.BeginUpdate();zip.Add(@"E:\文件1.txt");zip.Add(@"E:\文件2.txt");zip.CommitU 阅读全文
posted @ 2012-08-02 19:27 niky 阅读(486) 评论(0) 推荐(0)
摘要:public static string ToDescription(this Enum enumeration) { Type type = enumeration.GetType(); MemberInfo[] memInfo = type.GetMember(enumeration.ToString()); if (null != memInfo && memInfo.Length > 0) { object[] attrs = memInfo[0].GetCustomAttributes(type... 阅读全文
posted @ 2011-11-09 08:24 niky 阅读(251) 评论(0) 推荐(0)