上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 28 下一页
摘要: 一个例子 string value="123";Regex re=new Regex(^[0-9]{1,2}$);if(!re.IsMatch(value)){ }上面的代码用来判断字符串以数字开头和结尾,并且最多有2位。Regex re=new Regex(^[0-9]{1,2}$);解释: 这句:声明一个新的Regex,^表示:匹配字符串开始字符$表示:匹配结尾字符。[0-9]:匹配的数据类型... 阅读全文
posted @ 2011-05-13 10:34 DODUI 阅读(517) 评论(0) 推荐(0)
摘要: windows7下如何设置打印机共享解决方案1、设置网络共享,方法如下进入网络和共享中心--家庭组和共享选项选择更改高级共享设置修改共享设置共享设置基本完成。2、修改打印机共享在打印机图标上,单击鼠标右键选择“打印机属性”选择“共享”勾选“共享这台打印机” 阅读全文
posted @ 2011-05-11 11:41 DODUI 阅读(405) 评论(0) 推荐(0)
摘要: usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.IO;usingSystem.Collections;usingSystem.Text.RegularExpressions;namespacerandom{classProgram{//求随机数平均值方法staticdoubleAve(double[]a){doublesum=0;foreach(doubledina){sum=sum+d;}doubleave=sum/a.Length;returnave;}//求 阅读全文
posted @ 2011-04-20 10:45 DODUI 阅读(1396) 评论(0) 推荐(0)
摘要: Func,double>variance=numbers=>(fromninnumbersselectMath.Pow((n-numbers.Sum()/numbers.Count),2)).Sum()/numbers.Count;Console.Write(variance(newList{1,2,5,6})); 阅读全文
posted @ 2011-04-20 10:43 DODUI 阅读(539) 评论(0) 推荐(0)
摘要: 说鼠标在文本框边界的时候由于鼠标稍微一移动就会离开文本框 再一移动就会进入 所以会重复出现 把ToolTip t = new ToolTip(); 设为全局可见private void btnMainThreadException_MouseEnter(object sender, EventArgs e){t.Show("txt", btnMainThreadException);}添加离开事件private void btnMainThreadException_MouseLeave(object sender, EventArgs e){t.Hide( btnMain 阅读全文
posted @ 2011-03-03 14:31 DODUI 阅读(692) 评论(0) 推荐(0)
摘要: C# 使用正则表达式去掉字符串中的数字 /// /// 去掉字符串中的数字/// /// /// public static string RemoveNumber(string key){ return System.Text.RegularExpressions.Regex.Replace(key, @"\d", "");}/// /// 去掉字符串中的非数字/// /// /// public static string RemoveNotNumber(string key){ return System.Text.RegularExpressio 阅读全文
posted @ 2011-01-13 16:11 DODUI 阅读(1164) 评论(0) 推荐(1)
摘要: 1、字符串连接select concat('0591','8888888') || '转23' from dual结果:05918888888转232、首字母大写 select initcap('zhang san') from dual结果:Zhang San3、INSTR(C1,C2,I,J) 在一个字符串中搜索指定的字符,返回发现指定的字符的位置;C1 被搜索的字符串C2 希望搜索的字符串I 搜索的开始位置,默认为1J 出现的位置,默认为1select instr('test test','es 阅读全文
posted @ 2011-01-11 17:57 DODUI 阅读(435) 评论(0) 推荐(0)
摘要: static void Main(string[] args){ DataTable dt = new DataTable(); dt.Columns.Add("A"); dt.Columns.Add("B"); dt.Columns.Add("C"); dt.Rows.Add("a1", "b1", "c1"); dt.Rows.Add("a1", "b2", "c2"); dt.Rows.Add("a2 阅读全文
posted @ 2011-01-10 16:04 DODUI 阅读(1227) 评论(0) 推荐(0)
摘要: Oracle计算时间差表达式 --获取两时间的相差豪秒数select ceil((To_date('2008-05-02 00:00:00' , 'yyyy-mm-dd hh24-mi-ss') - To_date('2008-04-30 23:59:59' , 'yyyy-mm-dd hh24-mi-ss')) * 24 * 60 * 60 * 1000) 相差豪秒数 FROM DUAL;/*相差豪秒数---------- 864010001 row selected*/--获取两时间的相差秒数select ceil((To_d 阅读全文
posted @ 2011-01-10 11:27 DODUI 阅读(335) 评论(0) 推荐(0)
摘要: privateSystem.Collections.ArrayListlist=newSystem.Collections.ArrayList();System.Collections.HashtablemyHash=newSystem.Collections.Hashtable();myHash.Add("0","未提交");myHash.Add("1","提交");myHash.Add("2","已完成");myHash.Add("-1"," 阅读全文
posted @ 2011-01-06 13:46 DODUI 阅读(261) 评论(0) 推荐(0)
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 28 下一页