摘要: 1. 数据控件绑定时格式化日期方法:2. 用DataBinder.Eval进行数据绑定时:DataBinder.Eval(Container.DataItem,"AddTime","{0:yyyy-MM-dd}")3. 直接用ToString方法转换日期显示格式:DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")4. 用String类转换日期显示格式:String.Format("{0:yyyy-MM-dd}", DateTime.Now)5. 用DateTime.Parse方 阅读全文
posted @ 2013-06-27 09:16 MillerShi 阅读(867) 评论(1) 推荐(1) 编辑
摘要: T - SQL 模糊多条件查询实现[,分隔]if (Distribution_Address !="") { if (Distribution_Address.Trim().Length == 0) { strSql = " 1=1"; } else { int start =0;//设定替换前的字符串长度 int end = 0;//设定替换后的字符串长度 string temptxt = Distribution_Address.Trim(); do { start = temptxt.Length; temptxt = temptxt.Replac 阅读全文
posted @ 2013-03-29 17:21 MillerShi 阅读(154) 评论(0) 推荐(0) 编辑
摘要: overrride表示重写 这个类是继承于Shape类 public override double Area 这个属性再shape中肯定存在 但是这里我们不想用shape中的 所以要重写virtual是告诉其它想继承于他的类 你可以重写我的这个方法或属性,否则不允许。给你一个生动的例子 老爸表示基类(被继承的类) 儿子表示子类(继承的类):老爸用virtual告诉儿子:"孩子,你要继承我的事业,在这块上面可以自己继续发展你自己的" 儿子用override告诉全世界:"这个我可不是直接拿我爸的,他只是指个路给我,是我自己奋斗出来的" 阅读全文
posted @ 2013-01-22 16:04 MillerShi 阅读(239) 评论(0) 推荐(0) 编辑
摘要: //随机文件名称 public static string getRandomFileName(string fileName) { if (!string.IsNullOrEmpty(fileName)) { System.Threading.Thread.Sleep(100); string fileType = fileName.Substring(fileName.LastIndexOf(".")); System.Random rand = new System.Random(); DateTime now = DateTime.Now; string str = 阅读全文
posted @ 2012-11-01 17:36 MillerShi 阅读(340) 评论(0) 推荐(0) 编辑
摘要: window.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/htm 阅读全文
posted @ 2012-09-12 14:36 MillerShi 阅读(838) 评论(0) 推荐(0) 编辑
摘要: 一、用class_name方式写类名。 以前喜欢用class-name写,不过好像两样也没什么差别。但我比较反对用className写类名,因为始终对浏览器大小写敏感的问题抱有怀疑态度。但是id我会写成驼峰式,理由见下一条。 二、样式都用class而不用id。 有三个理由。 1,id不可以重复,所以用class的话,可以肆无忌惮的用无数次。 2,id的优先级太高,若是写了一个#page_content a {color:#f60} ,那你完蛋了,里面要改链接颜色,都必须加上#page_content才能越过这个优先级。 3,id专门留给JS用,这样才符合表现与行为分离的原则。所以i... 阅读全文
posted @ 2012-09-12 14:27 MillerShi 阅读(213) 评论(0) 推荐(0) 编辑
摘要: http://www.artcss.com/archives/477.htmlhttp://www.cnblogs.com/cloudgamer/archive/2008/09/15/1290954.html 阅读全文
posted @ 2012-09-11 15:47 MillerShi 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 首记录:this.dataGridView1.CurrentCell = this.dataGridView1[this.dataGridView1.CurrentCell.ColumnIndex, 0];上一记录:if (this.dataGridView1.CurrentCell.RowIndex > 0) { this.dataGridView1.CurrentCell = this.dataGridView1[this.dataGridView1.CurrentCell.ColumnIndex, this.dataGridView1.CurrentCell.RowIndex - 阅读全文
posted @ 2012-09-04 16:34 MillerShi 阅读(174) 评论(0) 推荐(0) 编辑