02 2013 档案
摘要:正像你所知道的那样,设置DIV大小 的有两个属性width和height,以前在学习DIV每次给DIV设置100%宽度或高度时都很迷惑,不明确这个100%的宽度(高度)到底有多宽有 多高?这个100%是从哪里得到的从哪里继承的?今天我们的话题就是有关div高度100%的问题!其实,要弄懂div宽度|width100%、div高度|height100%到底是怎么实现的,只需弄懂一个简单的问题就可以了,即100%的基数是谁,就是这个100%是相对于谁的width、height来说是100%?div的100%是从其上一级div的宽高继承来的,有一点很关键,就是要设置div100%显示,必须设置其上一
阅读全文
摘要:usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;usingSystem.Runtime.InteropServices; namespacecom.Longle.CommonLibrary.Web{public.
阅读全文
摘要:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Windows.Forms; namespaceWinformLogDemo{staticclassProgram{///<summary>///应用程序的主入口点。///</summary>[STAThread]staticvoidMain(){try{Application.EnableVisualStyles();Application.SetCompatibleTextRenderingDefault(false);A
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace TEST{ class Program { static void Main(string[] args) { //Obj obj = new Obj(); //Obj obj2 = obj; //obj.Value = "1"; //obj.ID = 1; //Console.WriteLine("obj.value:"+obj.Value +" ID:&quo
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Collections;namespace FluentInterfaceDemo{ class Program { static void Main(string[] args) { Fluent fluent = new Fluent(); fluent.Money = 10000; Console.WriteLine(fluent.IsPass(f => f.Money)); Console.W
阅读全文
摘要:摘要:今天我们漫谈C#中的垃圾回收机制,本文将从垃圾回收机制的原理讲起,希望对大家有所帮助。 GC的前世与今生 虽然本文是以.NET作为目标来讲述GC,但是GC的概念并非才诞生不久。早 在1958年,由鼎鼎大名的图林奖得主John McCarthy所实现的Lisp语言就已经提供了GC的功能,这是GC的第一次出现。Lisp的程序员认为内存管理太重要了,所以不能由程序员自己来管 理。 但后来的日子里Lisp却没有成气候,采用内存手动管理的语言占据了上风,以 C为代表。出于同样的理由,不同的人却又不同的看法,C程序员认为内存管理太重要了,所以不能由系统来管理,并且讥笑Lisp程序慢如乌龟的运行...
阅读全文
摘要:理解堆与栈对于理 解.NET中的内存管理、垃圾回收、错误和异常、调试与日志有很大的帮助。垃圾回收的机制使程序员从复杂的内存管理中解脱出来,虽然绝大多数的C#程序并 不需要程序员手动管理内存,但这并不代表程序员就无需了解分配的对象是如何被回收的,在一些特殊的场合仍需要程序员手动进行内存管理。在32位的处理器上,每个进程的虚拟内存为4GB,.NET会在这4GB的内存块中开辟出3块内存,分别作为栈、托管堆、和非托管堆堆(heap):堆是从下往上分配,所以已用的空间在自由空间下面,C#中所有引用类型的对象分配在托管堆上,托管堆在内存上是连续分配的,并且内存对象的释放受垃圾收集机制的管理,效率相对于栈来
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace TEST{ class Program { static void Main(string[] args) { Console.Write(GetFoo(10)); Console.Read(); } // static long GetFoo(int n) { ...
阅读全文