
C#
文章平均质量分 64
smalltt
enjoy life, enjoy programming
展开
-
XPath
XPath 是一门在 XML 文档中查找信息的语言。XPath 用于在 XML 文档中通过元素和属性进行导航。 什么是 XPath? XPath 使用路径表达式在 XML 文档中进行导航 XPath 包含一个标准函数库 XPath 是 XSLT 中的主要元素 XPath 是一个 W3C 标准 XPath 路径表达式 XPath 使用路径表达式来选取 XML 文档中的节点或者节点集。这些路径表达式和转载 2008-11-16 00:57:00 · 651 阅读 · 0 评论 -
SortedList 既是泛型又是非泛型的.NET类
SortedList类代码:using System;using System.Collections.Generic;using System.Text;using System.Collections;namespace SortedListHelper//注意 SortedList既是泛型非泛型{ class SortedListHelper { //pri原创 2008-12-03 02:31:00 · 558 阅读 · 0 评论 -
C# SortedList类介绍
SortedList 类 [C#] 命名空间: System.Collections 表示键/值对的集合,这些键和值按键排序并可按照键和索引访问。 SortedList 是 Hashtable 和 Array 的混合。当使用 Item 索引器属性按照元素的键访问元素时,其行为类似于 Hashtable。当使用 GetByIndex 或 SetByIndex 按照元素的索引访问元素时,其行为类原创 2008-12-03 23:30:00 · 2130 阅读 · 0 评论 -
C# Stack
Stack is a Simple DataStucture which allows Insert/Remove of Items at one end. It is basically called as LIFO (Last In First Out) data structure (i.e. the item which is added last is the first one to原创 2008-12-04 00:30:00 · 2898 阅读 · 0 评论 -
c# 流的概念以及一个操作文本文件的实例代码
//注意://在计算机编程中,流就是一个类的对象,很多文件的输入输出操作都以类的成员函数的方式来提供。 //计算机中的流其实是一种信息的转换。它是一种有序流,因此相对于某一对象,通常我们把对象接收外界的信息输入(Input)称为输入流,相应地从对象向外输出(Output)信息为输出流,合称为输入/输出流(I/O Streams)。对象间进行信息或者数据的交换时总是先将对象或数据转换为某种形式的流,原创 2008-12-08 01:27:00 · 1296 阅读 · 0 评论 -
C# StreamReader 和 StreamWriter 读取和写入汉字出现乱码的解决方法。
注意:汉字使用GB2312编码测试页面代码:using System;using System.Collections.Generic;using System.Text;namespace StreamReaderAndStreamWriter{ class Program { static void Main(string[] args) {原创 2008-12-09 02:16:00 · 5688 阅读 · 3 评论 -
asp.net(c#) static关键字用法小结+示例代码
静态变量 当我们编写一个类时,其实就是在描述其对象的属性和行为,而并没有产生实质上的对象,只有通过new关键字才会产生出对象,这时系统才会分配内存空间给对象,其方法才可以供外部调用。 有时候,我们希望无论是否产生了对象或无论产生了多少对象的情况下,某些特定的数据在内存空间里只有一份,例如所有的中国人都有国家名称,每一个中国人都共享这个国家名称,不必在每一个中国人转载 2008-12-10 02:03:00 · 823 阅读 · 0 评论 -
C#创建二维数组
static void Main(string[] args) { int row, colmu; Console.WriteLine("enter the row:"); row = Convert.ToInt32(Console.ReadLine()); Console.W原创 2012-04-01 16:02:30 · 5958 阅读 · 0 评论 -
C# 写的显示当前日期(某年某月某日)和星期几
protected void Page_Load(object sender, EventArgs e) { DateTime dt = DateTime.Now; Response.Write("当前日期是"+dt.Year+"年"+dt.Month+"月"+dt.Day+"日"); string s原创 2009-01-09 00:36:00 · 1844 阅读 · 2 评论 -
asp.net 写的图片上传页面
aspx页面代码http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/1999/xhtml" > 无标题页 上传图片 cs原创 2008-11-30 10:32:00 · 962 阅读 · 0 评论 -
C# Hashtable 正序和逆序排序
注意:Hashtable 按键的正序排列键/值对,默认情况下的遍历GetValues是逆序遍历。using System;using System.Collections.Generic;using System.Text;using System.Collections;namespace HashtableSort{ class Program { stati原创 2008-11-28 11:36:00 · 7631 阅读 · 0 评论 -
c#类型转换
看如下两个语句:using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication1{ class FirstProgram { static void Main(string[] args) { string原创 2008-11-17 02:13:00 · 424 阅读 · 0 评论 -
c# Enum
看如下两段代码,比较:第一段:using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication2{ class Program { static void Main(string[] args) { pub原创 2008-11-18 23:41:00 · 581 阅读 · 0 评论 -
string.format()用法
{0:d} YY-MM-DD{0:p} 百分比00.00%{0:N2} 12.68{0:N0} 13{0:c2} $12.68{0:d} 3/23/2003{0:T} 12:00:00 AM{0:男;;女} DataGrid-数据格式设置表达式 数据格式设置表达式 .NET Framework 格式设置表达式,它在数据显示在列中之前先应用于数据。此表达式由可选静态文本和用以下格式表示的格式说明原创 2008-11-22 00:37:00 · 1489 阅读 · 0 评论 -
bubble sort
基本思想冒泡排序的基本思想是:依次比较相邻的两个数,将大数放在前面,小数放在后面。即首先比较第1个和第2个数,将大数放前,小数放后。然后比较第2个数和第3个数,将大数放前,小数放后,如此继续,直至比较最后两个数,将大数放前,小数放后,此时第一趟结束,在最后的数必是所有数中的最小数。重复以上过程,仍从第一对数开始比较(因为可能由于第2个数和第3个数的交换,使得第1个数不再大于第2个数),将大数放前,原创 2008-11-22 01:00:00 · 696 阅读 · 0 评论 -
C#中"错误: 成员名称不能与它们的封闭类型相同"
using System; using System.Collections.Generic; using System.Text; namespace aaa { public class Program { static int n, m,s; static void Main(string[] args) { s=sum.sum(n,m); Console.WriteLine(s); } }原创 2008-11-23 11:17:00 · 23373 阅读 · 0 评论 -
C# ref类型 和 值类型
using System;using System.Collections.Generic;using System.Text;using System.Diagnostics;//本程序试验了值类型和引用类型的差异,值类型变量是不能直接修改的,只有通过其变量引用才能对内存中的值进行修改namespace ref_value{ class Program { stat原创 2008-11-25 00:17:00 · 3184 阅读 · 0 评论 -
C#泛型集合 using System.Collections.Generic
泛型最常见的用途是泛型集合,命名空间System.Collections.Generic 中包含了一些基于泛型的集合类,使用泛型集合类可以提供更高的类型安全性,还有更高的性能,避免了非泛型集合的重复的装箱和拆箱。 很多非泛型集合类都有对应的泛型集合类,下面是常用的非泛型集合类以及对应的泛型集合类:非泛型集合类泛型集合类ArrayListList原创 2008-11-27 00:51:00 · 14500 阅读 · 2 评论 -
C# Hashtable
一,哈希表(Hashtable)简述 在.NET Framework中,Hashtable是System.Collections命名空间提供的一个容器,用于处理和表现类似keyvalue的键值对,其中key通常可用来快速查找,但排序速度很慢。同时key是区分大小写;value用于存储对应于key的值。Hashtable中keyvalue键值对均为object类型,所以Hashtable可以支持原创 2008-11-28 01:28:00 · 3410 阅读 · 0 评论 -
bubble sorting
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace bubblesorting{ class Program { static void Main(string[] args) {原创 2012-04-05 20:26:43 · 660 阅读 · 0 评论