11 2012 档案
摘要:插入排序,由第二位开始,一个个往前适当的位置(比左边大,比右边小)插入using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication7{ class Class5 { //插入排序,由第二位开始,一个个往前适当的位置(比左边大,比右边小)插入 static void Main(string[] args) { int[] ary = { 32, 432, 5, 3...
阅读全文
摘要:看MSDN时,关键看这句话System.Drawing Namespace命名空间这句话,从这句话开始入手就行了.TheGraphicsclass provides methods for drawing to the display device.Classes such asRectangleandPointencapsulate GDI+ primitives.ThePenclass is used to draw lines and curves, while classes derived from the abstract classBrushare used to fill th
阅读全文
摘要:C#获取Excel各类信息的方法http://hi.baidu.com/it_program/item/66459ae9e7cd08395a7cfb33Cell1Type: System.ObjectThe name of the range in A1-style notation in the language of the application.It can include the range operator (a colon), the intersection operator (a space), or the union operator (a comma).It can a
阅读全文
摘要:对于文件,数据库,网络等非.NET资源,要显式地释放资源,MSDN有个例子using System;using System.ComponentModel;// The following example demonstrates how to create// a resource class that implements the IDisposable interface// and the IDisposable.Dispose method.public class DisposeExample{ // A base class that implements IDisposa...
阅读全文
摘要:通常情况下我们执行数据库操作时都会将SqlConnection实例先打开,用完之后就将它关闭.但万一我忘记关闭了,会造成什么后果.讲后果之前,我们先来说下SqlConnection是怎样和数据库建立连接的,当首次open时,数据库会对发来的连接串进行一系列验证,这个过程会花费比较长的时间,然后为它分配一个连接池,当下次再用这个串时,这连串的验证就可以跳过了,所以耗很短的时间就完成了open.但问题来了,如果再次连接时,它发现这个串对应的连接池没有关闭,则会重新分配一个连接池,当然也会进行那一系列验证,现在还会造成SQL进程不断增加.如下图,所以我们在open完之后一定要记录关闭.
阅读全文
摘要:以下代码可以对比FileStream 和BufferedStream的性能,但一定要注意BufferedStream初始时第二个参数一定要比第一个参数的流的大小要大,不然内存缓存就可能用不上static void Main(string[] args) { Random rd = new Random(); byte[] bb=new byte[1024]; rd.NextBytes(bb); FileStream fs = new FileStream(@"C:\Users\jim\Desk...
阅读全文
摘要:unicode 统一的一种编码,它包括ucs-2,ucs-4ucs 通用字符集ucs-2 两个字节编码,是常见的unicode编码ucs-4 四个字节编码window 文本的unicode是little endian 低位开头对于英文来说,直接用unicode来储存是非常浪费空间和不利于传输,所以就出现了UTF-8,UTF-8是unicode和一种实现方式,只是它的储存方式有所不同,它每个字节都有个头标记,如0XXX XXXX开头就表示一个字节为一个unicode编码,110X XXXX 10XX XXXX两个字节为一个unicode编码,UTF-16多出的部分是ucs-2还是ucs-4??1
阅读全文
摘要:<form action="HTMLPage2.htm?param4=param4" method="post"> <input type="hidden" name="param1" value="param1"> <input type="hidden" name="param2" value="param2"> <input type="text" name="
阅读全文
摘要:在网上找到加了这句可以解决问题<globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" culture="zh-CN"/>requestEncoding是设置Request的ContentEncoding属性,而responseEncoding是设置Response属性.还有,如发页面是responseEncoding="utf-8",而接收页requestEncoding
阅读全文
摘要:(1)变量编译时全部转为内存地址,而对变量的访问全是对该地址储存的值的访问.(2)初始化指针时只能是赋值地址,如int *p=&a;而其初始化时*p是赋该指针指向内存的值,如*p=a,而赋地址是这样,p=&a.(3)int aa[] = {12,13,423,12};char cc[]={'a','b'};内存是分配在栈上char ccc[]="acbcc";内存也是分配在栈上,只是开始时会放在数据段中char *cccc="acbcclll";则是在栈上存放该串的地址
阅读全文
浙公网安备 33010602011771号