2012年5月30日
摘要: namespace SampleListT{ class Program { static void Main(string[] args) { //using System.Collections.Generic; 命名空间... 阅读全文
posted @ 2012-05-30 14:15 swarb 阅读(449) 评论(0) 推荐(0) 编辑
  2012年5月24日
摘要: string path= System.Windows.Forms.Application.StartupPath + "\\ErrorLog\\"+fileName +".txt"; if (!File.Exists(p... 阅读全文
posted @ 2012-05-24 09:08 swarb 阅读(1349) 评论(0) 推荐(0) 编辑
  2012年5月21日
摘要: 枚举类型是一种的值类型,它用于声明一组命名的常数。 (1)枚举的声明:枚举声明用于声明新的枚举类型。 访问修辞符 enum 枚举名:基础类型 { 枚举成员 } 基础类型必须能够表示该枚举中定义的所有枚举数值。枚举声明可以显... 阅读全文
posted @ 2012-05-21 13:57 swarb 阅读(161) 评论(0) 推荐(0) 编辑
摘要: ArrayList 的名称空间是 System.Collections。ArrayList 元素类型和数组不同,ArrayList 的各个元素的类型可以不同。声明对象//声明 ArrayList 有三种重载方法,较常用的有两种ArrayList al = new Ar... 阅读全文
posted @ 2012-05-21 11:26 swarb 阅读(152) 评论(0) 推荐(0) 编辑
  2012年5月18日
摘要: 出处:http://hi.baidu.com/%BA%EC%C3%F1/blog/item/68025ee7807f972cb83820fb.html只需要在Global.asax加上几行代码就行了,我们是通过捕获用户的请求,然后通过RewritePath来实现的:... 阅读全文
posted @ 2012-05-18 17:30 swarb 阅读(163) 评论(0) 推荐(0) 编辑
  2012年5月15日
摘要: 会使用索引,导致全表扫描情况1.不要使用in操作符,这样数据库会进行全表扫描,推荐方案:在业务密集的SQL当中尽量不采用IN操作符2.not in 使用not in也不会走索引推荐方案:用not exists或者(外联结+判断为空)来代替3 操作符(不等于) 使用同样... 阅读全文
posted @ 2012-05-15 15:30 swarb 阅读(96) 评论(0) 推荐(0) 编辑
摘要: for (Int32 i = 0; i <= tasklist.Rows.Count - 1; i++) { DataG1.Rows.Add(); for (Int32 j = 0; j <= tasklist.Columns.Count - 1; j++) { o... 阅读全文
posted @ 2012-05-15 10:19 swarb 阅读(407) 评论(0) 推荐(0) 编辑
  2012年5月3日
摘要: 1、用字符串分隔: using System.Text.RegularExpressions;string str="aaajsbbbjsccc";string[] sArray=Regex.Split(str,"js",RegexOptions.IgnoreCase... 阅读全文
posted @ 2012-05-03 15:27 swarb 阅读(672) 评论(0) 推荐(0) 编辑
摘要: IndexOf() 查找字串中指定字符或字串首次出现的位置,返首索引值,如: str1.IndexOf("字"); //查找“字”在str1中的索引值(位置) str1.IndexOf("字串");//查找“字串”的第一个字符在str1中的索引值(位置) str1.I... 阅读全文
posted @ 2012-05-03 09:47 swarb 阅读(151) 评论(0) 推荐(0) 编辑
  2012年4月28日
摘要: System.IO.DriveInfo[] disk = System.IO.DriveInfo.GetDrives(); foreach (System.IO.DriveInfo di in disk) { ... 阅读全文
posted @ 2012-04-28 10:58 swarb 阅读(151) 评论(0) 推荐(0) 编辑