![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C#
文章平均质量分 75
linjone
这个作者很懒,什么都没留下…
展开
-
asp.net判断页面加载所用时间
DateTime dt; protected override void OnPreInit(EventArgs e) { dt = DateTime.Now; base.OnPreInit(e); } public override void RenderControl原创 2009-01-19 22:03:00 · 322 阅读 · 0 评论 -
用datatalbe.toTable方法去除DataTable中的重复项
在SQL 中有一个dintinct 关键字可以去除重复项,在.net2.0中有能使用dintinct关键字,在在.net2.0中datatable.totable方法可以实现该功能如下:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/原创 2009-07-07 11:27:00 · 745 阅读 · 0 评论 -
DataTable.Compute()方法的使用
一、DataTable.Compute()方法說明如下作用: 计算用来传递筛选条件的当前行上的给定表达式。 格式為: Object Compute (string expression,string filter) 参数: expression:要计算的表达式。 expression 参数需要聚合函数。 filter:要限制在原创 2009-07-07 10:43:00 · 1311 阅读 · 1 评论 -
.net中完成海量数据的批量插入和更新
对于海量数据的插入和更新,ADO.NET确实不如JDBC做到好,JDBC有统一的模型来进行批操作.使用起来非常方便: PreparedStatement ps = conn.prepareStatement("insert or update arg1,args2...."); 然后你就可以 for(int i=0;i ps.setXXX(realArg); ..... ps.addB原创 2008-12-20 20:48:00 · 1962 阅读 · 1 评论 -
asp.net个人学习历程初学到精通
如果你是一个菜鸟或者自认为初学者那么本文非常适合你; 不能说这30本书就是最佳组合,但是可以说这个组合不差; 本人曾博览群书,很多书重复,很多书讲的不适用,这些书都是目前书店可以买到的; 达到中级程序员以后怎么成为高级程序员就靠你自己了,而此时你已经有辨明是非的能力,这也就是本文的目的! 30本好书点评: 分4大方向( html--Web的基础; javascript--让网页动起来; C#--原创 2009-03-03 22:49:00 · 351 阅读 · 0 评论 -
C# 集合类(一):ArrayList 类的使用
System.Collections 命名空间包含接口和类,这些接口和类定义各种对象(如列表、队列、位数组、哈希表和字典)的集合。System.Collections.Generic 命名空间包含定义泛型集合的接口和类,泛型集合允许用户创建强类型集合,它能提供比非泛型强类型集合更好的类型安全性和性能。System.Collections.Specialized 命名空间包含专用的和强类型的集合,原创 2008-12-13 16:09:00 · 450 阅读 · 3 评论 -
C#中StringBuilder类的使用
String 对象是不可改变的。每次使用 System.String 类中的方法之一时,都要在内存中创建一个新的字符串对象,这就需要为该新对象分配新的空间。在需要对字符串执行重复修改的情况下,与创建新的 String 对象相关的系统开销可能会非常昂贵。如果要修改字符串而不创建新的对象,则可以使用 System.Text.StringBuilder 类。例如,当在一个循环中将许多字符原创 2008-12-13 12:19:00 · 189 阅读 · 0 评论 -
DataGrid支持分页的自动编号代码
错误只有本页编号的写法 或在ItemDataBound事件中加 if (e.Item.ItemIndex > -1) { e.Item.Cells[0].Text原创 2008-12-13 10:49:00 · 208 阅读 · 0 评论 -
window应用程序打开窗体的几种方法
一、打开MDI子窗体,且允许重复打开FrmMytest frmMytest = new FrmMytest();frmMytest.MdiParent = this;frmMytest.Show(); 二、打开MDI子窗体,但不允许重复打开;即如果窗体未打开过,则直接打开,如果打开过,原来的窗体直接显示在最上面int index = HaveOpened(this转载 2008-12-13 10:39:00 · 993 阅读 · 0 评论 -
C# 集合类(五):SortedList类的使用
SortedList类:表示键/值对的集合,与哈希表类似,区别在于SortedList中的Key数组排好序的。Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->using System;using System.Collecti原创 2008-12-13 16:17:00 · 755 阅读 · 0 评论 -
C# 集合类(三):Stack类的使用
Stack:栈,表示对象的简单的后进先出非泛型集合。Push方法入栈,Pop方法出栈。Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->using System;using System.Collections.Generic;原创 2008-12-13 16:15:00 · 609 阅读 · 0 评论 -
C# 集合类(二):Queue类的使用
Queue:队列,表示对象的先进先出集合。Enqueue方法入队列,Dequeue方法出队列。Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->using System;using System.Collections.Gene原创 2008-12-13 16:14:00 · 1981 阅读 · 0 评论 -
xml文件.net操纵类(c#)
1using System; 2using System.Xml; 3using System.Web; 4namespace MX.XML 5{ 6 /**//// 7 /// XML核心类: 8 /// 必需用XPath表达式来获取相应节点 9 /// 10 public class Core 11 { 12原创 2008-12-13 16:05:00 · 317 阅读 · 0 评论 -
用C#和SQL获得当前月的第一天和最后一天
在开发过程中碰到了取当月的第一天和最后一天,在网上搜索了半天,找到一个在C#中和SQL语句的解决方法.C# 程序代码int year = DateTime.Now.Year;int month = DateTime.Now.Month;DateTime firstDayOfThisMonth = new DateTime(year, month, 1);DateTime lastDayOf原创 2008-12-13 15:09:00 · 396 阅读 · 0 评论 -
文件创建及读取的方法
创建文件 String filePath = HttpContext.Current.Server.MapPath("a.txt"); if (!System.IO.File.Exists(filePath))// 创建文件 System.IO.File.Create(filePath); System.IO.StreamWri原创 2008-12-13 16:00:00 · 284 阅读 · 0 评论 -
Asp.net之数组应用
string[] abc=new string[8]{"1","2","3","4","1","2","3","4"};Response.Write(Array.IndexOf(abc,"3",1));//在abc数组中查找"3",从abc[1]开始找Response.Write(Array.LastIndexOf(abc,"3"));//在abc数组中查找"3",从最后开始找----------原创 2009-01-19 21:50:00 · 224 阅读 · 0 评论 -
获取CPU 网卡 硬盘ID序号
用 System.Management 访问管理信息System.Management 命名空间是 .NET 框架中的 WMI 命名空间。此命名空间包括下列支持 WMI 操作的第一级类对象:ManagementObject 或 ManagementClass:分别为单个管理对象或类。ManagementObjectSearcher:用于根据指定的查询或枚举检索 Mana原创 2009-12-29 11:47:00 · 269 阅读 · 0 评论